{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Pandas\n",
    "\n",
    "Pandas是基于Numpy的专业数据分析工具，可以灵活高效的处理各种数据集，也是我们后期分析案例的神器。它提供了两种类型的数据结构，分别是DataFrame和Series，我们可以简单的把DataFrame理解为Excel里面的一张表，而Series就是表中的某一列，后面学习和用到的所有Pandas操作，都是基于这些表和列进行的操作。\n",
    "\n",
    "这里有一点需要强调，Pandas和Excel、SQL相比，只是调用和处理数据的方式变了，核心都是对源数据进行一系列的处理，在正式处理之前，更重要的是谋定而后动，明确分析的意义，理清分析思路之后再处理和分析数据，往往事半功倍。\n",
    "\n",
    "参考：\n",
    "官方文档 https://pandas.pydata.org/pandas-docs/stable/getting_started/index.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 创建、读取和存储\n",
    "\n",
    "在Pandas中我们想要构造一张表，第一步一定是先导入我们的库——import pandas as pd\n",
    "\n",
    "构造DataFrame最常用的方式是**字典+列表**，语句很简单，先是字典外括，然后依次打出每一列标题及其对应的列值（此处一定要用列表），这里列的顺序并不重要："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bob</th>\n",
       "      <th>Sue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>I liked it.</td>\n",
       "      <td>Pretty good.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>It was awful.</td>\n",
       "      <td>Bland.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Bob           Sue\n",
       "0    I liked it.  Pretty good.\n",
       "1  It was awful.        Bland."
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df1 = pd.DataFrame({'Yes': [50, 21], 'No': [131, 2]})\n",
    "df2 = pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], 'Sue': ['Pretty good.', 'Bland.']})\n",
    "df1\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们使用pd.DataFrame构造函数来生成这些DataFrame对象。创建新对象的语法是初始化一个字典，其键是列名（本例中为Bob和Sue），其值是条目列表。 这是构建新DataFrame的标准方法，也是你最容易遇到的方法。\n",
    "\n",
    "字典列表的构造函数为列标签分配值，但只使用0（0,1,2,3，...）的递增计数作为行标签。 有时候这没关系，但我们经常会想要自己分配这些行标签。\n",
    "\n",
    "DataFrame中使用的行标签列表称为索引。 我们可以在构造函数中使用索引参数为其赋值：\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bob</th>\n",
       "      <th>Sue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Product A</th>\n",
       "      <td>I liked it.</td>\n",
       "      <td>Pretty good.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Product B</th>\n",
       "      <td>It was awful.</td>\n",
       "      <td>Bland.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Bob           Sue\n",
       "Product A    I liked it.  Pretty good.\n",
       "Product B  It was awful.        Bland."
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], \n",
    "              'Sue': ['Pretty good.', 'Bland.']},\n",
    "             index=['Product A', 'Product B'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "相比之下，Series是一系列数据值。 如果DataFrame是表，则Series是列表。 事实上，你可以创建一个Series只有一个列表："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    3\n",
       "3    4\n",
       "4    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Series([1, 2, 3, 4, 5])\n",
    "p"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series本质上是DataFrame的单个列。 因此，你可以使用索引参数以与之前相同的方式为Series分配列值。 但是，Series没有列名，它只有一个总名称："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[30L, 35L, 40L]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "k = pd.Series([30, 35, 40], index=['2015 Sales', '2016 Sales', '2017 Sales'], name='Product A')\n",
    "k.values.tolist()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series和DataFrame密切相关。 将DataFrame视为实际上只是一堆Series**粘合在一起**是有帮助的。\n",
    "\n",
    "#### 读取数据\n",
    "\n",
    "能够手动创建DataFrame和Series非常方便。 但是，在大多数情况下，我们实际上不会手动创建自己的数据，我们将使用已经存在的数据。\n",
    "\n",
    "数据可以以多种不同的形式和格式存储。 到目前为止，其中最基本的是简单的**CSV文件**，以及**xls文件**。\n",
    "\n",
    "*你可以在本repo中下载课件中提到的文件，或者使用Github Desktop来下载所有的文件到本地（推荐）*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "0      20200724  002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
      "1      20200723  002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
      "2      20200722  002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   \n",
      "3      20200721  002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   \n",
      "4      20200720  002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   \n",
      "5      20200717  002747.SZ  14.86  15.80  14.80  15.43      14.87    0.56   \n",
      "6      20200716  002747.SZ  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
      "7      20200715  002747.SZ  15.40  15.60  14.80  15.23      15.20    0.03   \n",
      "8      20200714  002747.SZ  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
      "9      20200713  002747.SZ  14.97  15.43  14.75  15.32      15.12    0.20   \n",
      "10     20200710  002747.SZ  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
      "11     20200709  002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41   \n",
      "12     20200708  002747.SZ  13.03  14.40  13.03  14.09      13.09    1.00   \n",
      "13     20200707  002747.SZ  13.05  13.55  12.92  13.09      13.00    0.09   \n",
      "14     20200706  002747.SZ  12.97  13.16  12.78  13.00      12.90    0.10   \n",
      "15     20200703  002747.SZ  12.39  13.10  12.30  12.90      12.35    0.55   \n",
      "16     20200702  002747.SZ  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
      "17     20200701  002747.SZ  11.95  12.65  11.80  12.38      11.96    0.42   \n",
      "18     20200630  002747.SZ  11.62  12.15  11.51  11.96      11.58    0.38   \n",
      "19     20200629  002747.SZ  11.17  11.77  10.96  11.58      11.19    0.39   \n",
      "20     20200624  002747.SZ  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
      "21     20200623  002747.SZ  11.09  11.72  11.03  11.35      11.08    0.27   \n",
      "22     20200622  002747.SZ  11.10  11.31  10.93  11.08      11.05    0.03   \n",
      "23     20200619  002747.SZ  11.15  11.20  10.93  11.05      11.05    0.00   \n",
      "24     20200618  002747.SZ  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
      "25     20200617  002747.SZ  11.40  11.69  11.10  11.33      10.96    0.37   \n",
      "26     20200616  002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00   \n",
      "27     20200615  002747.SZ  10.24  10.37   9.95   9.96      10.24   -0.28   \n",
      "28     20200612  002747.SZ  10.20  10.38  10.09  10.24      10.41   -0.17   \n",
      "29     20200611  002747.SZ  10.50  10.69  10.34  10.41      10.52   -0.11   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "707    20170811  002747.SZ  12.20  12.68  12.08  12.11      12.40   -0.29   \n",
      "708    20170810  002747.SZ  12.12  12.40  11.50  12.40      12.24    0.16   \n",
      "709    20170809  002747.SZ  11.91  12.50  11.91  12.24      11.86    0.38   \n",
      "710    20170808  002747.SZ  11.48  11.88  11.41  11.86      11.50    0.36   \n",
      "711    20170807  002747.SZ  11.43  11.71  11.43  11.50      11.55   -0.05   \n",
      "712    20170804  002747.SZ  11.90  11.90  11.54  11.55      11.90   -0.35   \n",
      "713    20170803  002747.SZ  11.59  11.97  11.45  11.90      11.78    0.12   \n",
      "714    20170802  002747.SZ  11.17  12.30  11.17  11.78      11.19    0.59   \n",
      "715    20170801  002747.SZ  11.02  11.26  11.02  11.19      11.15    0.04   \n",
      "716    20170731  002747.SZ  11.12  11.27  11.09  11.15      11.18   -0.03   \n",
      "717    20170728  002747.SZ  11.30  11.49  11.17  11.18      11.41   -0.23   \n",
      "718    20170727  002747.SZ  11.26  11.58  11.01  11.41      11.19    0.22   \n",
      "719    20170726  002747.SZ  11.18  11.27  11.08  11.19      11.29   -0.10   \n",
      "720    20170725  002747.SZ  11.34  11.42  11.06  11.29      11.52   -0.23   \n",
      "721    20170724  002747.SZ  11.19  11.88  11.11  11.52      11.12    0.40   \n",
      "722    20170721  002747.SZ  10.30  11.12  10.28  11.12      10.11    1.01   \n",
      "723    20170720  002747.SZ  10.05  10.20   9.99  10.11      10.06    0.05   \n",
      "724    20170719  002747.SZ   9.97  10.06   9.88  10.06       9.98    0.08   \n",
      "725    20170718  002747.SZ   9.94   9.99   9.80   9.98       9.84    0.14   \n",
      "726    20170717  002747.SZ  10.63  10.63   9.71   9.84      10.67   -0.83   \n",
      "727    20170714  002747.SZ  10.66  10.75  10.56  10.67      10.66    0.01   \n",
      "728    20170713  002747.SZ  10.72  10.75  10.59  10.66      10.77   -0.11   \n",
      "729    20170712  002747.SZ  10.95  11.03  10.45  10.77      10.96   -0.19   \n",
      "730    20170711  002747.SZ  11.04  11.14  10.93  10.96      11.02   -0.06   \n",
      "731    20170710  002747.SZ  11.22  11.26  11.00  11.02      11.28   -0.26   \n",
      "732    20170707  002747.SZ  11.36  11.43  11.22  11.28      11.43   -0.15   \n",
      "733    20170706  002747.SZ  11.49  11.53  11.36  11.43      11.53   -0.10   \n",
      "734    20170705  002747.SZ  11.52  11.65  11.47  11.53      11.56   -0.03   \n",
      "735    20170704  002747.SZ  11.50  11.68  11.45  11.56      11.50    0.06   \n",
      "736    20170703  002747.SZ  11.44  11.55  11.30  11.50      11.44    0.06   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "0    -1.8776  285487.23  460908.718  \n",
      "1    -8.0223  332693.07  561431.842  \n",
      "2     4.2998  184201.74  325956.565  \n",
      "3     1.4143  226621.76  390465.486  \n",
      "4     9.9806  320102.62  530137.992  \n",
      "5     3.7660  199292.16  305435.914  \n",
      "6    -2.3638  229290.80  353556.481  \n",
      "7     0.1974  213356.58  323258.908  \n",
      "8    -0.7833  222269.86  340759.697  \n",
      "9     1.3228  184452.45  278886.698  \n",
      "10   -2.4516  218210.43  329484.318  \n",
      "11   10.0071  267772.91  395199.486  \n",
      "12    7.6394  293345.03  407198.381  \n",
      "13    0.6923  184150.75  243893.075  \n",
      "14    0.7752  241303.32  313084.240  \n",
      "15    4.4534  218369.18  278710.530  \n",
      "16   -0.2423  164501.68  201440.634  \n",
      "17    3.5117  228877.17  280866.551  \n",
      "18    3.2815  192286.30  228599.446  \n",
      "19    3.4853  207979.77  237171.977  \n",
      "20   -1.4097  124793.19  140215.789  \n",
      "21    2.4368  223595.75  256107.121  \n",
      "22    0.2715  145578.40  161746.863  \n",
      "23    0.0000  113959.89  125997.534  \n",
      "24   -2.4713  150478.58  168049.284  \n",
      "25    3.3759  278214.10  313691.260  \n",
      "26   10.0402  177673.09  188478.610  \n",
      "27   -2.7344  131237.86  133263.669  \n",
      "28   -1.6330   80052.00   81944.184  \n",
      "29   -1.0456   73533.43   77291.533  \n",
      "..       ...        ...         ...  \n",
      "707  -2.3400  128648.45  158873.570  \n",
      "708   1.3100  146709.17  176845.683  \n",
      "709   3.2000  219338.05  269819.114  \n",
      "710   3.1300   88519.42  103280.902  \n",
      "711  -0.4300   48891.15   56568.247  \n",
      "712  -2.9400   82981.10   96903.331  \n",
      "713   1.0200  142621.06  167400.909  \n",
      "714   5.2700  199954.40  236128.395  \n",
      "715   0.3600   49487.00   55171.080  \n",
      "716  -0.2700   58034.70   64747.384  \n",
      "717  -2.0200   65969.35   74327.418  \n",
      "718   1.9700  114912.20  130409.432  \n",
      "719  -0.8900   64690.43   72190.146  \n",
      "720  -2.0000  110796.27  124175.062  \n",
      "721   3.6000  225583.50  259010.552  \n",
      "722   9.9900  161723.79  177758.596  \n",
      "723   0.5000   31004.69   31373.829  \n",
      "724   0.8000   26258.85   26217.149  \n",
      "725   1.4200   34114.27   33835.607  \n",
      "726  -7.7800   63451.74   63665.201  \n",
      "727   0.0900   33957.00   36189.361  \n",
      "728  -1.0200   30273.71   32311.916  \n",
      "729  -1.7300   64813.01   68976.373  \n",
      "730  -0.5400   43952.33   48403.254  \n",
      "731  -2.3100   62700.04   69415.697  \n",
      "732  -1.3100   69776.46   78795.099  \n",
      "733  -0.8700   51529.62   58924.662  \n",
      "734  -0.2600   50503.45   58339.668  \n",
      "735   0.5200   50820.01   58857.307  \n",
      "736   0.5200   41711.00   47616.602  \n",
      "\n",
      "[737 rows x 11 columns]\n",
      "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
      "trade_date                                                                      \n",
      "20200724    002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31  -1.8776   \n",
      "20200723    002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44  -8.0223   \n",
      "20200722    002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   4.2998   \n",
      "20200721    002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   1.4143   \n",
      "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
      "20200717    002747.SZ  14.86  15.80  14.80  15.43      14.87    0.56   3.7660   \n",
      "20200716    002747.SZ  14.95  16.10  14.83  14.87      15.23   -0.36  -2.3638   \n",
      "20200715    002747.SZ  15.40  15.60  14.80  15.23      15.20    0.03   0.1974   \n",
      "20200714    002747.SZ  15.21  16.16  14.68  15.20      15.32   -0.12  -0.7833   \n",
      "20200713    002747.SZ  14.97  15.43  14.75  15.32      15.12    0.20   1.3228   \n",
      "20200710    002747.SZ  15.63  15.68  14.60  15.12      15.50   -0.38  -2.4516   \n",
      "20200709    002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41  10.0071   \n",
      "20200708    002747.SZ  13.03  14.40  13.03  14.09      13.09    1.00   7.6394   \n",
      "20200707    002747.SZ  13.05  13.55  12.92  13.09      13.00    0.09   0.6923   \n",
      "20200706    002747.SZ  12.97  13.16  12.78  13.00      12.90    0.10   0.7752   \n",
      "20200703    002747.SZ  12.39  13.10  12.30  12.90      12.35    0.55   4.4534   \n",
      "20200702    002747.SZ  12.37  12.48  12.05  12.35      12.38   -0.03  -0.2423   \n",
      "20200701    002747.SZ  11.95  12.65  11.80  12.38      11.96    0.42   3.5117   \n",
      "20200630    002747.SZ  11.62  12.15  11.51  11.96      11.58    0.38   3.2815   \n",
      "20200629    002747.SZ  11.17  11.77  10.96  11.58      11.19    0.39   3.4853   \n",
      "20200624    002747.SZ  11.32  11.41  11.08  11.19      11.35   -0.16  -1.4097   \n",
      "20200623    002747.SZ  11.09  11.72  11.03  11.35      11.08    0.27   2.4368   \n",
      "20200622    002747.SZ  11.10  11.31  10.93  11.08      11.05    0.03   0.2715   \n",
      "20200619    002747.SZ  11.15  11.20  10.93  11.05      11.05    0.00   0.0000   \n",
      "20200618    002747.SZ  11.22  11.39  11.00  11.05      11.33   -0.28  -2.4713   \n",
      "20200617    002747.SZ  11.40  11.69  11.10  11.33      10.96    0.37   3.3759   \n",
      "20200616    002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00  10.0402   \n",
      "20200615    002747.SZ  10.24  10.37   9.95   9.96      10.24   -0.28  -2.7344   \n",
      "20200612    002747.SZ  10.20  10.38  10.09  10.24      10.41   -0.17  -1.6330   \n",
      "20200611    002747.SZ  10.50  10.69  10.34  10.41      10.52   -0.11  -1.0456   \n",
      "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
      "20170811    002747.SZ  12.20  12.68  12.08  12.11      12.40   -0.29  -2.3400   \n",
      "20170810    002747.SZ  12.12  12.40  11.50  12.40      12.24    0.16   1.3100   \n",
      "20170809    002747.SZ  11.91  12.50  11.91  12.24      11.86    0.38   3.2000   \n",
      "20170808    002747.SZ  11.48  11.88  11.41  11.86      11.50    0.36   3.1300   \n",
      "20170807    002747.SZ  11.43  11.71  11.43  11.50      11.55   -0.05  -0.4300   \n",
      "20170804    002747.SZ  11.90  11.90  11.54  11.55      11.90   -0.35  -2.9400   \n",
      "20170803    002747.SZ  11.59  11.97  11.45  11.90      11.78    0.12   1.0200   \n",
      "20170802    002747.SZ  11.17  12.30  11.17  11.78      11.19    0.59   5.2700   \n",
      "20170801    002747.SZ  11.02  11.26  11.02  11.19      11.15    0.04   0.3600   \n",
      "20170731    002747.SZ  11.12  11.27  11.09  11.15      11.18   -0.03  -0.2700   \n",
      "20170728    002747.SZ  11.30  11.49  11.17  11.18      11.41   -0.23  -2.0200   \n",
      "20170727    002747.SZ  11.26  11.58  11.01  11.41      11.19    0.22   1.9700   \n",
      "20170726    002747.SZ  11.18  11.27  11.08  11.19      11.29   -0.10  -0.8900   \n",
      "20170725    002747.SZ  11.34  11.42  11.06  11.29      11.52   -0.23  -2.0000   \n",
      "20170724    002747.SZ  11.19  11.88  11.11  11.52      11.12    0.40   3.6000   \n",
      "20170721    002747.SZ  10.30  11.12  10.28  11.12      10.11    1.01   9.9900   \n",
      "20170720    002747.SZ  10.05  10.20   9.99  10.11      10.06    0.05   0.5000   \n",
      "20170719    002747.SZ   9.97  10.06   9.88  10.06       9.98    0.08   0.8000   \n",
      "20170718    002747.SZ   9.94   9.99   9.80   9.98       9.84    0.14   1.4200   \n",
      "20170717    002747.SZ  10.63  10.63   9.71   9.84      10.67   -0.83  -7.7800   \n",
      "20170714    002747.SZ  10.66  10.75  10.56  10.67      10.66    0.01   0.0900   \n",
      "20170713    002747.SZ  10.72  10.75  10.59  10.66      10.77   -0.11  -1.0200   \n",
      "20170712    002747.SZ  10.95  11.03  10.45  10.77      10.96   -0.19  -1.7300   \n",
      "20170711    002747.SZ  11.04  11.14  10.93  10.96      11.02   -0.06  -0.5400   \n",
      "20170710    002747.SZ  11.22  11.26  11.00  11.02      11.28   -0.26  -2.3100   \n",
      "20170707    002747.SZ  11.36  11.43  11.22  11.28      11.43   -0.15  -1.3100   \n",
      "20170706    002747.SZ  11.49  11.53  11.36  11.43      11.53   -0.10  -0.8700   \n",
      "20170705    002747.SZ  11.52  11.65  11.47  11.53      11.56   -0.03  -0.2600   \n",
      "20170704    002747.SZ  11.50  11.68  11.45  11.56      11.50    0.06   0.5200   \n",
      "20170703    002747.SZ  11.44  11.55  11.30  11.50      11.44    0.06   0.5200   \n",
      "\n",
      "                  vol      amount  \n",
      "trade_date                         \n",
      "20200724    285487.23  460908.718  \n",
      "20200723    332693.07  561431.842  \n",
      "20200722    184201.74  325956.565  \n",
      "20200721    226621.76  390465.486  \n",
      "20200720    320102.62  530137.992  \n",
      "20200717    199292.16  305435.914  \n",
      "20200716    229290.80  353556.481  \n",
      "20200715    213356.58  323258.908  \n",
      "20200714    222269.86  340759.697  \n",
      "20200713    184452.45  278886.698  \n",
      "20200710    218210.43  329484.318  \n",
      "20200709    267772.91  395199.486  \n",
      "20200708    293345.03  407198.381  \n",
      "20200707    184150.75  243893.075  \n",
      "20200706    241303.32  313084.240  \n",
      "20200703    218369.18  278710.530  \n",
      "20200702    164501.68  201440.634  \n",
      "20200701    228877.17  280866.551  \n",
      "20200630    192286.30  228599.446  \n",
      "20200629    207979.77  237171.977  \n",
      "20200624    124793.19  140215.789  \n",
      "20200623    223595.75  256107.121  \n",
      "20200622    145578.40  161746.863  \n",
      "20200619    113959.89  125997.534  \n",
      "20200618    150478.58  168049.284  \n",
      "20200617    278214.10  313691.260  \n",
      "20200616    177673.09  188478.610  \n",
      "20200615    131237.86  133263.669  \n",
      "20200612     80052.00   81944.184  \n",
      "20200611     73533.43   77291.533  \n",
      "...               ...         ...  \n",
      "20170811    128648.45  158873.570  \n",
      "20170810    146709.17  176845.683  \n",
      "20170809    219338.05  269819.114  \n",
      "20170808     88519.42  103280.902  \n",
      "20170807     48891.15   56568.247  \n",
      "20170804     82981.10   96903.331  \n",
      "20170803    142621.06  167400.909  \n",
      "20170802    199954.40  236128.395  \n",
      "20170801     49487.00   55171.080  \n",
      "20170731     58034.70   64747.384  \n",
      "20170728     65969.35   74327.418  \n",
      "20170727    114912.20  130409.432  \n",
      "20170726     64690.43   72190.146  \n",
      "20170725    110796.27  124175.062  \n",
      "20170724    225583.50  259010.552  \n",
      "20170721    161723.79  177758.596  \n",
      "20170720     31004.69   31373.829  \n",
      "20170719     26258.85   26217.149  \n",
      "20170718     34114.27   33835.607  \n",
      "20170717     63451.74   63665.201  \n",
      "20170714     33957.00   36189.361  \n",
      "20170713     30273.71   32311.916  \n",
      "20170712     64813.01   68976.373  \n",
      "20170711     43952.33   48403.254  \n",
      "20170710     62700.04   69415.697  \n",
      "20170707     69776.46   78795.099  \n",
      "20170706     51529.62   58924.662  \n",
      "20170705     50503.45   58339.668  \n",
      "20170704     50820.01   58857.307  \n",
      "20170703     41711.00   47616.602  \n",
      "\n",
      "[737 rows x 10 columns]\n"
     ]
    }
   ],
   "source": [
    "df1 = pd.read_csv('stock_data.csv')\n",
    "print(df1)\n",
    "df2 = pd.read_csv('stock_data.csv', index_col=0)\n",
    "#df = pd.read_excel(\"stock_data.xls\", sheet_name='price')\n",
    "print(df2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从电脑的文件夹里提取文件\n",
    "# 文件保存路径：F:\\hongdou\\1111111111111111课程\\Python\\python_course-master\\BasicSession\n",
    "# (1)\n",
    "path = 'F:\\\\hongdou\\\\1111111111111111课程\\\\Python\\\\python_course-master\\\\BasicSession\\\\stock_data.csv'\n",
    "df1 = pd.read_csv(path)\n",
    "df2 = pd.read_csv(path, index_col=0)\n",
    "df1\n",
    "df2\n",
    "# (2)\n",
    "path2 = 'F:/hongdou/1111111111111111课程/Python/python_course-master/BasicSession/stock_data.csv'\n",
    "df3 = pd.read_csv(path2, index_col=0)\n",
    "df3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 存储数据\n",
    "\n",
    "将数据写入文件通常比从一个文件中读取数据更容易，因为pandas会为你处理转换的麻烦。\n",
    "\n",
    "我们将再次使用CSV文件。 read_csv（读取我们的数据）的反义词是to_csv，写入它。 使用CSV文件很简单。 要写回Excel文件，需要再次使用to_excel和sheet_name。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('stock_data.csv', index_col=0)\n",
    "df.to_csv('result.csv')\n",
    "#df.to_excel('stock_data_head.xls', sheet_name='price')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 保存文件到电脑里的文件夹\n",
    "path = 'F:\\\\hongdou\\\\1111111111111111课程\\\\Python\\\\python_course-master\\\\BasicSession\\\\stock_data.csv'\n",
    "df = pd.read_csv(path, index_col=0)\n",
    "df.to_csv('F:\\\\hongdou\\\\1111111111111111课程\\\\Python\\\\python_course-master\\\\BasicSession\\\\result.csv\n",
    "  # pandas的to_csv()使用方法: https://blog.csdn.net/toshibahuai/article/details/79034829"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**统计信息概览**\n",
    "\n",
    "快速计算数值型数据的关键统计指标，像平均数、中位数、标准差等等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>11.002198</td>\n",
       "      <td>11.244084</td>\n",
       "      <td>10.789118</td>\n",
       "      <td>11.017123</td>\n",
       "      <td>11.010475</td>\n",
       "      <td>0.006649</td>\n",
       "      <td>0.093007</td>\n",
       "      <td>90858.378725</td>\n",
       "      <td>106162.360978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1.889141</td>\n",
       "      <td>1.976465</td>\n",
       "      <td>1.827325</td>\n",
       "      <td>1.908847</td>\n",
       "      <td>1.899236</td>\n",
       "      <td>0.343773</td>\n",
       "      <td>2.983851</td>\n",
       "      <td>70279.618800</td>\n",
       "      <td>96928.400735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.950000</td>\n",
       "      <td>7.750000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>-1.440000</td>\n",
       "      <td>-10.018600</td>\n",
       "      <td>7829.000000</td>\n",
       "      <td>7891.632000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.560000</td>\n",
       "      <td>9.210000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>-0.170000</td>\n",
       "      <td>-1.530000</td>\n",
       "      <td>45415.130000</td>\n",
       "      <td>46596.916000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>10.890000</td>\n",
       "      <td>11.080000</td>\n",
       "      <td>10.610000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>68256.230000</td>\n",
       "      <td>75595.631000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>12.280000</td>\n",
       "      <td>12.560000</td>\n",
       "      <td>12.020000</td>\n",
       "      <td>12.290000</td>\n",
       "      <td>12.280000</td>\n",
       "      <td>0.160000</td>\n",
       "      <td>1.414300</td>\n",
       "      <td>110826.680000</td>\n",
       "      <td>130335.838000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.800000</td>\n",
       "      <td>18.180000</td>\n",
       "      <td>16.900000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>1.540000</td>\n",
       "      <td>10.043700</td>\n",
       "      <td>543655.080000</td>\n",
       "      <td>814316.938000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             open        high         low       close   pre_close      change  \\\n",
       "count  737.000000  737.000000  737.000000  737.000000  737.000000  737.000000   \n",
       "mean    11.002198   11.244084   10.789118   11.017123   11.010475    0.006649   \n",
       "std      1.889141    1.976465    1.827325    1.908847    1.899236    0.343773   \n",
       "min      7.770000    7.950000    7.750000    7.770000    7.770000   -1.440000   \n",
       "25%      9.360000    9.560000    9.210000    9.360000    9.360000   -0.170000   \n",
       "50%     10.890000   11.080000   10.610000   10.850000   10.850000    0.000000   \n",
       "75%     12.280000   12.560000   12.020000   12.290000   12.280000    0.160000   \n",
       "max     17.800000   18.180000   16.900000   17.950000   17.950000    1.540000   \n",
       "\n",
       "          pct_chg            vol         amount  \n",
       "count  737.000000     737.000000     737.000000  \n",
       "mean     0.093007   90858.378725  106162.360978  \n",
       "std      2.983851   70279.618800   96928.400735  \n",
       "min    -10.018600    7829.000000    7891.632000  \n",
       "25%     -1.530000   45415.130000   46596.916000  \n",
       "50%      0.000000   68256.230000   75595.631000  \n",
       "75%      1.414300  110826.680000  130335.838000  \n",
       "max     10.043700  543655.080000  814316.938000  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**列的基本处理方式**\n",
    "\n",
    "这里，我们采用SQL四大法宝的逻辑来简单梳理针对列的基本处理方式——增、删、选、改。\n",
    "\n",
    "温馨提示：使用Pandas时，尽量避免用行或者EXCEL操作单元格的思维来处理数据，要逐渐养成一种列向思维，每一列是同宗同源。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**增**  增加一列，用df['新列名'] = 新列值的形式，在原数据基础上赋值即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>new_col</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "20200724    002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31  -1.8776   \n",
       "20200723    002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44  -8.0223   \n",
       "20200722    002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   4.2998   \n",
       "20200721    002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   1.4143   \n",
       "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
       "\n",
       "                  vol      amount  new_col  \n",
       "trade_date                                  \n",
       "20200724    285487.23  460908.718        1  \n",
       "20200723    332693.07  561431.842        2  \n",
       "20200722    184201.74  325956.565        3  \n",
       "20200721    226621.76  390465.486        4  \n",
       "20200720    320102.62  530137.992        5  "
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['new_col'] = range(1, len(df)+1)\n",
    "len(df)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**删**  我们用drop函数制定删除对应的列，axis = 1表示针对列的操作，inplace为True，则直接在源数据上进行修改，否则源数据会保持原样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.drop('new_col', axis = 1, inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "20200724    002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31  -1.8776   \n",
       "20200723    002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44  -8.0223   \n",
       "20200722    002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   4.2998   \n",
       "20200721    002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   1.4143   \n",
       "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
       "\n",
       "                  vol      amount  \n",
       "trade_date                         \n",
       "20200724    285487.23  460908.718  \n",
       "20200723    332693.07  561431.842  \n",
       "20200722    184201.74  325956.565  \n",
       "20200721    226621.76  390465.486  \n",
       "20200720    320102.62  530137.992  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "有人能帮我理解一下，在pandas、numpy、scipy三都当中axis参数的真实含义吗？\n",
    "\n",
    "投票最高的答案揭示了问题的本质：\n",
    "\n",
    "- 其实问题理解axis有问题，df.mean其实是在每一行上取所有列的均值，而不是保留每一列的均值。也许简单的来记就是axis=0代表往跨行（down)，而axis=1代表跨列（across)，作为方法动作的副词\n",
    "\n",
    "![](assets/axis.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选** 想要选取某一列怎么办？df['列名']即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "20200724    002747.SZ\n",
       "20200723    002747.SZ\n",
       "20200722    002747.SZ\n",
       "20200721    002747.SZ\n",
       "20200720    002747.SZ\n",
       "20200717    002747.SZ\n",
       "20200716    002747.SZ\n",
       "20200715    002747.SZ\n",
       "20200714    002747.SZ\n",
       "20200713    002747.SZ\n",
       "20200710    002747.SZ\n",
       "20200709    002747.SZ\n",
       "20200708    002747.SZ\n",
       "20200707    002747.SZ\n",
       "20200706    002747.SZ\n",
       "20200703    002747.SZ\n",
       "20200702    002747.SZ\n",
       "20200701    002747.SZ\n",
       "20200630    002747.SZ\n",
       "20200629    002747.SZ\n",
       "20200624    002747.SZ\n",
       "20200623    002747.SZ\n",
       "20200622    002747.SZ\n",
       "20200619    002747.SZ\n",
       "20200618    002747.SZ\n",
       "20200617    002747.SZ\n",
       "20200616    002747.SZ\n",
       "20200615    002747.SZ\n",
       "20200612    002747.SZ\n",
       "20200611    002747.SZ\n",
       "              ...    \n",
       "20170811    002747.SZ\n",
       "20170810    002747.SZ\n",
       "20170809    002747.SZ\n",
       "20170808    002747.SZ\n",
       "20170807    002747.SZ\n",
       "20170804    002747.SZ\n",
       "20170803    002747.SZ\n",
       "20170802    002747.SZ\n",
       "20170801    002747.SZ\n",
       "20170731    002747.SZ\n",
       "20170728    002747.SZ\n",
       "20170727    002747.SZ\n",
       "20170726    002747.SZ\n",
       "20170725    002747.SZ\n",
       "20170724    002747.SZ\n",
       "20170721    002747.SZ\n",
       "20170720    002747.SZ\n",
       "20170719    002747.SZ\n",
       "20170718    002747.SZ\n",
       "20170717    002747.SZ\n",
       "20170714    002747.SZ\n",
       "20170713    002747.SZ\n",
       "20170712    002747.SZ\n",
       "20170711    002747.SZ\n",
       "20170710    002747.SZ\n",
       "20170707    002747.SZ\n",
       "20170706    002747.SZ\n",
       "20170705    002747.SZ\n",
       "20170704    002747.SZ\n",
       "20170703    002747.SZ\n",
       "Name: ts_code, Length: 737, dtype: object"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['ts_code']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             open   high\n",
       "trade_date              \n",
       "20200724    16.80  16.81\n",
       "20200723    17.80  18.07\n",
       "20200722    17.12  18.18\n",
       "20200721    17.20  17.87\n",
       "20200720    15.80  16.97"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['open','high']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "20200724    16.80\n",
       "20200723    17.80\n",
       "20200722    17.12\n",
       "20200721    17.20\n",
       "20200720    15.80\n",
       "Name: open, dtype: float64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['open'].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**改**  简单的更改：df['旧列名'] =  某个值或者某列值，就完成了对原列数值的修改"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "20200724    316.80\n",
       "20200723    317.80\n",
       "20200722    317.12\n",
       "20200721    317.20\n",
       "20200720    315.80\n",
       "Name: open, dtype: float64"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['open'] = df['open'] + 100\n",
    "df['open'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>316.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>317.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>317.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>317.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>315.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code    open   high    low  close  pre_close  change  \\\n",
       "trade_date                                                              \n",
       "20200724    002747.SZ  316.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "20200723    002747.SZ  317.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "20200722    002747.SZ  317.12  18.18  16.90  17.95      17.21    0.74   \n",
       "20200721    002747.SZ  317.20  17.87  16.77  17.21      16.97    0.24   \n",
       "20200720    002747.SZ  315.80  16.97  15.50  16.97      15.43    1.54   \n",
       "\n",
       "            pct_chg        vol      amount  \n",
       "trade_date                                  \n",
       "20200724    -1.8776  285487.23  460908.718  \n",
       "20200723    -8.0223  332693.07  561431.842  \n",
       "20200722     4.2998  184201.74  325956.565  \n",
       "20200721     1.4143  226621.76  390465.486  \n",
       "20200720     9.9806  320102.62  530137.992  "
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选（复杂索引）**  基于判断，输出布尔值，可以把这一列判断得到的值传入行参数位置，Pandas会默认返回结果为True的行（这里是索引从0到12的行），而丢掉结果为False的行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "20200724     True\n",
       "20200723     True\n",
       "20200722     True\n",
       "20200721     True\n",
       "20200720     True\n",
       "20200717     True\n",
       "20200716     True\n",
       "20200715     True\n",
       "20200714     True\n",
       "20200713     True\n",
       "20200710     True\n",
       "20200709     True\n",
       "20200708     True\n",
       "20200707     True\n",
       "20200706     True\n",
       "20200703     True\n",
       "20200702     True\n",
       "20200701     True\n",
       "20200630     True\n",
       "20200629     True\n",
       "20200624     True\n",
       "20200623     True\n",
       "20200622     True\n",
       "20200619     True\n",
       "20200618     True\n",
       "20200617     True\n",
       "20200616     True\n",
       "20200615     True\n",
       "20200612    False\n",
       "20200611    False\n",
       "            ...  \n",
       "20170811     True\n",
       "20170810     True\n",
       "20170809     True\n",
       "20170808    False\n",
       "20170807    False\n",
       "20170804    False\n",
       "20170803     True\n",
       "20170802     True\n",
       "20170801    False\n",
       "20170731    False\n",
       "20170728    False\n",
       "20170727     True\n",
       "20170726    False\n",
       "20170725     True\n",
       "20170724     True\n",
       "20170721     True\n",
       "20170720    False\n",
       "20170719    False\n",
       "20170718    False\n",
       "20170717    False\n",
       "20170714    False\n",
       "20170713    False\n",
       "20170712    False\n",
       "20170711    False\n",
       "20170710    False\n",
       "20170707    False\n",
       "20170706    False\n",
       "20170705    False\n",
       "20170704    False\n",
       "20170703    False\n",
       "Name: vol, Length: 737, dtype: bool"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 输出交易量大于平均交易量的数据\n",
    "df['vol']\n",
    "df['vol'].mean()\n",
    "df['vol'] > df['vol'].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200717</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.86</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.87</td>\n",
       "      <td>0.56</td>\n",
       "      <td>3.7660</td>\n",
       "      <td>199292.16</td>\n",
       "      <td>305435.914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200716</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.95</td>\n",
       "      <td>16.10</td>\n",
       "      <td>14.83</td>\n",
       "      <td>14.87</td>\n",
       "      <td>15.23</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.3638</td>\n",
       "      <td>229290.80</td>\n",
       "      <td>353556.481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200715</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.40</td>\n",
       "      <td>15.60</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.23</td>\n",
       "      <td>15.20</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>213356.58</td>\n",
       "      <td>323258.908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200714</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.21</td>\n",
       "      <td>16.16</td>\n",
       "      <td>14.68</td>\n",
       "      <td>15.20</td>\n",
       "      <td>15.32</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.7833</td>\n",
       "      <td>222269.86</td>\n",
       "      <td>340759.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200713</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.32</td>\n",
       "      <td>15.12</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.3228</td>\n",
       "      <td>184452.45</td>\n",
       "      <td>278886.698</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200710</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.63</td>\n",
       "      <td>15.68</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.12</td>\n",
       "      <td>15.50</td>\n",
       "      <td>-0.38</td>\n",
       "      <td>-2.4516</td>\n",
       "      <td>218210.43</td>\n",
       "      <td>329484.318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200708</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.40</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.09</td>\n",
       "      <td>13.09</td>\n",
       "      <td>1.00</td>\n",
       "      <td>7.6394</td>\n",
       "      <td>293345.03</td>\n",
       "      <td>407198.381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200707</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.05</td>\n",
       "      <td>13.55</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.09</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.6923</td>\n",
       "      <td>184150.75</td>\n",
       "      <td>243893.075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200706</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.97</td>\n",
       "      <td>13.16</td>\n",
       "      <td>12.78</td>\n",
       "      <td>13.00</td>\n",
       "      <td>12.90</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7752</td>\n",
       "      <td>241303.32</td>\n",
       "      <td>313084.240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200703</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.39</td>\n",
       "      <td>13.10</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.90</td>\n",
       "      <td>12.35</td>\n",
       "      <td>0.55</td>\n",
       "      <td>4.4534</td>\n",
       "      <td>218369.18</td>\n",
       "      <td>278710.530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200702</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.37</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.05</td>\n",
       "      <td>12.35</td>\n",
       "      <td>12.38</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2423</td>\n",
       "      <td>164501.68</td>\n",
       "      <td>201440.634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200701</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.95</td>\n",
       "      <td>12.65</td>\n",
       "      <td>11.80</td>\n",
       "      <td>12.38</td>\n",
       "      <td>11.96</td>\n",
       "      <td>0.42</td>\n",
       "      <td>3.5117</td>\n",
       "      <td>228877.17</td>\n",
       "      <td>280866.551</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200630</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.62</td>\n",
       "      <td>12.15</td>\n",
       "      <td>11.51</td>\n",
       "      <td>11.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2815</td>\n",
       "      <td>192286.30</td>\n",
       "      <td>228599.446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200629</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.77</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.39</td>\n",
       "      <td>3.4853</td>\n",
       "      <td>207979.77</td>\n",
       "      <td>237171.977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200624</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.32</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.35</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4097</td>\n",
       "      <td>124793.19</td>\n",
       "      <td>140215.789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200623</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.09</td>\n",
       "      <td>11.72</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.08</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.4368</td>\n",
       "      <td>223595.75</td>\n",
       "      <td>256107.121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200622</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.31</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.2715</td>\n",
       "      <td>145578.40</td>\n",
       "      <td>161746.863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200619</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>113959.89</td>\n",
       "      <td>125997.534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200618</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.39</td>\n",
       "      <td>11.00</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.33</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.4713</td>\n",
       "      <td>150478.58</td>\n",
       "      <td>168049.284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200617</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.40</td>\n",
       "      <td>11.69</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.96</td>\n",
       "      <td>0.37</td>\n",
       "      <td>3.3759</td>\n",
       "      <td>278214.10</td>\n",
       "      <td>313691.260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200616</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200615</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.37</td>\n",
       "      <td>9.95</td>\n",
       "      <td>9.96</td>\n",
       "      <td>10.24</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.7344</td>\n",
       "      <td>131237.86</td>\n",
       "      <td>133263.669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200609</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.95</td>\n",
       "      <td>10.60</td>\n",
       "      <td>10.74</td>\n",
       "      <td>10.90</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4679</td>\n",
       "      <td>107257.02</td>\n",
       "      <td>115350.037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200608</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.84</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.98</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.7286</td>\n",
       "      <td>118986.02</td>\n",
       "      <td>130820.131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170918</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.76</td>\n",
       "      <td>15.26</td>\n",
       "      <td>14.53</td>\n",
       "      <td>14.68</td>\n",
       "      <td>14.97</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-1.9400</td>\n",
       "      <td>153897.99</td>\n",
       "      <td>228707.483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170915</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.58</td>\n",
       "      <td>15.14</td>\n",
       "      <td>14.36</td>\n",
       "      <td>14.97</td>\n",
       "      <td>14.81</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.0800</td>\n",
       "      <td>201289.19</td>\n",
       "      <td>297906.732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170914</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.13</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>14.81</td>\n",
       "      <td>14.95</td>\n",
       "      <td>-0.14</td>\n",
       "      <td>-0.9400</td>\n",
       "      <td>353446.43</td>\n",
       "      <td>539255.175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170913</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.49</td>\n",
       "      <td>15.06</td>\n",
       "      <td>14.00</td>\n",
       "      <td>14.95</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.25</td>\n",
       "      <td>1.7000</td>\n",
       "      <td>328431.65</td>\n",
       "      <td>476672.593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170912</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.56</td>\n",
       "      <td>14.58</td>\n",
       "      <td>14.70</td>\n",
       "      <td>14.82</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.8100</td>\n",
       "      <td>543655.08</td>\n",
       "      <td>814316.938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170911</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170908</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.79</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.47</td>\n",
       "      <td>13.87</td>\n",
       "      <td>-0.40</td>\n",
       "      <td>-2.8800</td>\n",
       "      <td>251060.04</td>\n",
       "      <td>337836.218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170907</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.30</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.81</td>\n",
       "      <td>13.87</td>\n",
       "      <td>14.44</td>\n",
       "      <td>-0.57</td>\n",
       "      <td>-3.9500</td>\n",
       "      <td>245508.61</td>\n",
       "      <td>344740.766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170906</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.96</td>\n",
       "      <td>14.74</td>\n",
       "      <td>13.88</td>\n",
       "      <td>14.44</td>\n",
       "      <td>14.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.4000</td>\n",
       "      <td>341862.55</td>\n",
       "      <td>491219.726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170905</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.57</td>\n",
       "      <td>13.22</td>\n",
       "      <td>14.24</td>\n",
       "      <td>13.53</td>\n",
       "      <td>0.71</td>\n",
       "      <td>5.2500</td>\n",
       "      <td>409734.21</td>\n",
       "      <td>574570.382</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170904</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170829</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.69</td>\n",
       "      <td>-0.24</td>\n",
       "      <td>-1.8900</td>\n",
       "      <td>94616.85</td>\n",
       "      <td>117154.873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170828</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.69</td>\n",
       "      <td>12.47</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.7600</td>\n",
       "      <td>107939.73</td>\n",
       "      <td>137234.693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170824</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.83</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.84</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.8000</td>\n",
       "      <td>111538.10</td>\n",
       "      <td>138581.242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170823</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.45</td>\n",
       "      <td>13.43</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.84</td>\n",
       "      <td>12.26</td>\n",
       "      <td>0.58</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>188946.84</td>\n",
       "      <td>243652.628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170822</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.85</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.26</td>\n",
       "      <td>12.74</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.7700</td>\n",
       "      <td>106203.76</td>\n",
       "      <td>132018.325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170818</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.60</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.92</td>\n",
       "      <td>-0.26</td>\n",
       "      <td>-2.0100</td>\n",
       "      <td>103992.25</td>\n",
       "      <td>132189.295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170817</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.28</td>\n",
       "      <td>13.56</td>\n",
       "      <td>12.18</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>4.3600</td>\n",
       "      <td>241490.81</td>\n",
       "      <td>309030.232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170816</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.29</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.7300</td>\n",
       "      <td>92100.24</td>\n",
       "      <td>113470.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170815</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.16</td>\n",
       "      <td>12.29</td>\n",
       "      <td>12.47</td>\n",
       "      <td>-0.18</td>\n",
       "      <td>-1.4400</td>\n",
       "      <td>96385.67</td>\n",
       "      <td>118870.079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170814</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.58</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.11</td>\n",
       "      <td>0.36</td>\n",
       "      <td>2.9700</td>\n",
       "      <td>115510.84</td>\n",
       "      <td>143132.278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170811</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.08</td>\n",
       "      <td>12.11</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-2.3400</td>\n",
       "      <td>128648.45</td>\n",
       "      <td>158873.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170810</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.12</td>\n",
       "      <td>12.40</td>\n",
       "      <td>11.50</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.24</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.3100</td>\n",
       "      <td>146709.17</td>\n",
       "      <td>176845.683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170809</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.50</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.24</td>\n",
       "      <td>11.86</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2000</td>\n",
       "      <td>219338.05</td>\n",
       "      <td>269819.114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170803</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.59</td>\n",
       "      <td>11.97</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.78</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.0200</td>\n",
       "      <td>142621.06</td>\n",
       "      <td>167400.909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170802</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.17</td>\n",
       "      <td>12.30</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.78</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.59</td>\n",
       "      <td>5.2700</td>\n",
       "      <td>199954.40</td>\n",
       "      <td>236128.395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170727</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.01</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.9700</td>\n",
       "      <td>114912.20</td>\n",
       "      <td>130409.432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170725</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.34</td>\n",
       "      <td>11.42</td>\n",
       "      <td>11.06</td>\n",
       "      <td>11.29</td>\n",
       "      <td>11.52</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.0000</td>\n",
       "      <td>110796.27</td>\n",
       "      <td>124175.062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.88</td>\n",
       "      <td>11.11</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.12</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>225583.50</td>\n",
       "      <td>259010.552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>249 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "20200724    002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31  -1.8776   \n",
       "20200723    002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44  -8.0223   \n",
       "20200722    002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   4.2998   \n",
       "20200721    002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   1.4143   \n",
       "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
       "20200717    002747.SZ  14.86  15.80  14.80  15.43      14.87    0.56   3.7660   \n",
       "20200716    002747.SZ  14.95  16.10  14.83  14.87      15.23   -0.36  -2.3638   \n",
       "20200715    002747.SZ  15.40  15.60  14.80  15.23      15.20    0.03   0.1974   \n",
       "20200714    002747.SZ  15.21  16.16  14.68  15.20      15.32   -0.12  -0.7833   \n",
       "20200713    002747.SZ  14.97  15.43  14.75  15.32      15.12    0.20   1.3228   \n",
       "20200710    002747.SZ  15.63  15.68  14.60  15.12      15.50   -0.38  -2.4516   \n",
       "20200709    002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41  10.0071   \n",
       "20200708    002747.SZ  13.03  14.40  13.03  14.09      13.09    1.00   7.6394   \n",
       "20200707    002747.SZ  13.05  13.55  12.92  13.09      13.00    0.09   0.6923   \n",
       "20200706    002747.SZ  12.97  13.16  12.78  13.00      12.90    0.10   0.7752   \n",
       "20200703    002747.SZ  12.39  13.10  12.30  12.90      12.35    0.55   4.4534   \n",
       "20200702    002747.SZ  12.37  12.48  12.05  12.35      12.38   -0.03  -0.2423   \n",
       "20200701    002747.SZ  11.95  12.65  11.80  12.38      11.96    0.42   3.5117   \n",
       "20200630    002747.SZ  11.62  12.15  11.51  11.96      11.58    0.38   3.2815   \n",
       "20200629    002747.SZ  11.17  11.77  10.96  11.58      11.19    0.39   3.4853   \n",
       "20200624    002747.SZ  11.32  11.41  11.08  11.19      11.35   -0.16  -1.4097   \n",
       "20200623    002747.SZ  11.09  11.72  11.03  11.35      11.08    0.27   2.4368   \n",
       "20200622    002747.SZ  11.10  11.31  10.93  11.08      11.05    0.03   0.2715   \n",
       "20200619    002747.SZ  11.15  11.20  10.93  11.05      11.05    0.00   0.0000   \n",
       "20200618    002747.SZ  11.22  11.39  11.00  11.05      11.33   -0.28  -2.4713   \n",
       "20200617    002747.SZ  11.40  11.69  11.10  11.33      10.96    0.37   3.3759   \n",
       "20200616    002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00  10.0402   \n",
       "20200615    002747.SZ  10.24  10.37   9.95   9.96      10.24   -0.28  -2.7344   \n",
       "20200609    002747.SZ  10.88  10.95  10.60  10.74      10.90   -0.16  -1.4679   \n",
       "20200608    002747.SZ  11.03  11.23  10.84  10.90      10.98   -0.08  -0.7286   \n",
       "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
       "20170918    002747.SZ  14.76  15.26  14.53  14.68      14.97   -0.29  -1.9400   \n",
       "20170915    002747.SZ  14.58  15.14  14.36  14.97      14.81    0.16   1.0800   \n",
       "20170914    002747.SZ  15.13  15.80  14.80  14.81      14.95   -0.14  -0.9400   \n",
       "20170913    002747.SZ  14.49  15.06  14.00  14.95      14.70    0.25   1.7000   \n",
       "20170912    002747.SZ  14.75  15.56  14.58  14.70      14.82   -0.12  -0.8100   \n",
       "20170911    002747.SZ  13.50  14.82  13.37  14.82      13.47    1.35  10.0200   \n",
       "20170908    002747.SZ  13.78  13.79  13.24  13.47      13.87   -0.40  -2.8800   \n",
       "20170907    002747.SZ  14.30  14.32  13.81  13.87      14.44   -0.57  -3.9500   \n",
       "20170906    002747.SZ  13.96  14.74  13.88  14.44      14.24    0.20   1.4000   \n",
       "20170905    002747.SZ  13.48  14.57  13.22  14.24      13.53    0.71   5.2500   \n",
       "20170904    002747.SZ  12.22  13.53  12.22  13.53      12.30    1.23  10.0000   \n",
       "20170829    002747.SZ  12.54  12.54  12.30  12.45      12.69   -0.24  -1.8900   \n",
       "20170828    002747.SZ  12.52  12.89  12.52  12.69      12.47    0.22   1.7600   \n",
       "20170824    002747.SZ  12.83  12.86  12.20  12.48      12.84   -0.36  -2.8000   \n",
       "20170823    002747.SZ  12.45  13.43  12.45  12.84      12.26    0.58   4.7300   \n",
       "20170822    002747.SZ  12.80  12.85  12.20  12.26      12.74   -0.48  -3.7700   \n",
       "20170818    002747.SZ  12.76  12.89  12.60  12.66      12.92   -0.26  -2.0100   \n",
       "20170817    002747.SZ  12.28  13.56  12.18  12.92      12.38    0.54   4.3600   \n",
       "20170816    002747.SZ  12.38  12.54  12.10  12.38      12.29    0.09   0.7300   \n",
       "20170815    002747.SZ  12.44  12.67  12.16  12.29      12.47   -0.18  -1.4400   \n",
       "20170814    002747.SZ  12.10  12.58  12.10  12.47      12.11    0.36   2.9700   \n",
       "20170811    002747.SZ  12.20  12.68  12.08  12.11      12.40   -0.29  -2.3400   \n",
       "20170810    002747.SZ  12.12  12.40  11.50  12.40      12.24    0.16   1.3100   \n",
       "20170809    002747.SZ  11.91  12.50  11.91  12.24      11.86    0.38   3.2000   \n",
       "20170803    002747.SZ  11.59  11.97  11.45  11.90      11.78    0.12   1.0200   \n",
       "20170802    002747.SZ  11.17  12.30  11.17  11.78      11.19    0.59   5.2700   \n",
       "20170727    002747.SZ  11.26  11.58  11.01  11.41      11.19    0.22   1.9700   \n",
       "20170725    002747.SZ  11.34  11.42  11.06  11.29      11.52   -0.23  -2.0000   \n",
       "20170724    002747.SZ  11.19  11.88  11.11  11.52      11.12    0.40   3.6000   \n",
       "20170721    002747.SZ  10.30  11.12  10.28  11.12      10.11    1.01   9.9900   \n",
       "\n",
       "                  vol      amount  \n",
       "trade_date                         \n",
       "20200724    285487.23  460908.718  \n",
       "20200723    332693.07  561431.842  \n",
       "20200722    184201.74  325956.565  \n",
       "20200721    226621.76  390465.486  \n",
       "20200720    320102.62  530137.992  \n",
       "20200717    199292.16  305435.914  \n",
       "20200716    229290.80  353556.481  \n",
       "20200715    213356.58  323258.908  \n",
       "20200714    222269.86  340759.697  \n",
       "20200713    184452.45  278886.698  \n",
       "20200710    218210.43  329484.318  \n",
       "20200709    267772.91  395199.486  \n",
       "20200708    293345.03  407198.381  \n",
       "20200707    184150.75  243893.075  \n",
       "20200706    241303.32  313084.240  \n",
       "20200703    218369.18  278710.530  \n",
       "20200702    164501.68  201440.634  \n",
       "20200701    228877.17  280866.551  \n",
       "20200630    192286.30  228599.446  \n",
       "20200629    207979.77  237171.977  \n",
       "20200624    124793.19  140215.789  \n",
       "20200623    223595.75  256107.121  \n",
       "20200622    145578.40  161746.863  \n",
       "20200619    113959.89  125997.534  \n",
       "20200618    150478.58  168049.284  \n",
       "20200617    278214.10  313691.260  \n",
       "20200616    177673.09  188478.610  \n",
       "20200615    131237.86  133263.669  \n",
       "20200609    107257.02  115350.037  \n",
       "20200608    118986.02  130820.131  \n",
       "...               ...         ...  \n",
       "20170918    153897.99  228707.483  \n",
       "20170915    201289.19  297906.732  \n",
       "20170914    353446.43  539255.175  \n",
       "20170913    328431.65  476672.593  \n",
       "20170912    543655.08  814316.938  \n",
       "20170911    490574.54  708201.434  \n",
       "20170908    251060.04  337836.218  \n",
       "20170907    245508.61  344740.766  \n",
       "20170906    341862.55  491219.726  \n",
       "20170905    409734.21  574570.382  \n",
       "20170904    312931.88  409827.692  \n",
       "20170829     94616.85  117154.873  \n",
       "20170828    107939.73  137234.693  \n",
       "20170824    111538.10  138581.242  \n",
       "20170823    188946.84  243652.628  \n",
       "20170822    106203.76  132018.325  \n",
       "20170818    103992.25  132189.295  \n",
       "20170817    241490.81  309030.232  \n",
       "20170816     92100.24  113470.570  \n",
       "20170815     96385.67  118870.079  \n",
       "20170814    115510.84  143132.278  \n",
       "20170811    128648.45  158873.570  \n",
       "20170810    146709.17  176845.683  \n",
       "20170809    219338.05  269819.114  \n",
       "20170803    142621.06  167400.909  \n",
       "20170802    199954.40  236128.395  \n",
       "20170727    114912.20  130409.432  \n",
       "20170725    110796.27  124175.062  \n",
       "20170724    225583.50  259010.552  \n",
       "20170721    161723.79  177758.596  \n",
       "\n",
       "[249 rows x 10 columns]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['vol'] > df['vol'].mean(),:]\n",
    "  # 找出所有满足条件df['vol'] > df['vol'].mean()的数据\n",
    "  # 后面的冒号指所有的列\n",
    "\n",
    "  # df.loc[]:\n",
    "  #   根据行，列的标签进行查询\n",
    "  #   整数或者字符串，整数必须为标签名，如 df.loc[1] 行标签为1的行 、df.loc['abc'] 行标签为abc的行\n",
    "  #   列表，df.loc[['a','b','c']] 索引行标签分别为 a,b,c的行\n",
    "  #   切片，df.loc['a':'b'] 索引行标签为从a到b的行，df.loc[:] 所有行 df.loc[:,:] 索引所有行和列\n",
    "  #   布尔数组，长度需要与轴的长度一致，df.loc[[True,True,False]] 索引为True的行\n",
    "  #   函数，df.loc[df.index != 2,:] 索引除行标签为2外的所有行和列\n",
    "\n",
    "  # df.iloc[]:\n",
    "  #   根据行，列的数字位置进行查询\n",
    "  #   整数 ，df.iloc[3] 索引位置为3的行，即第四行\n",
    "  #   整数列表，df.iloc[[0,2,3]] 索引第一、三、四行\n",
    "  #   切片，df.iloc[0:3] 索引第一到第四行 ，df.loc[:,:] 索引所有行和列\n",
    "  #   布尔数组，长度需要与轴的长度一致，df.loc[[True,True,False]]，索引为True的行\n",
    "  #   函数，data.iloc[data.index != 0]  索引除第一行外所有行\n",
    "\n",
    "  #  (1)pandas df.loc[] 与 df.iloc[] 详解及其区别，建议收藏:\n",
    "  #   https://blog.csdn.net/weixin_48701352/article/details/120247544\n",
    "  # (2)[Pandas总结]第五节 Pandas 数据查询方法总结_df.loc()总结: \n",
    "  #   https://blog.csdn.net/weixin_47139649/article/details/126854365"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "姓名    小张\n",
       "学号     2\n",
       "成绩    90\n",
       "Name: b, dtype: object"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 例子：pandas df.loc[] 与 df.iloc[] 详解区别\n",
    "import pandas as pd\n",
    "dic = {'学号':[1,2,3,4,5],\n",
    "       '姓名':['小王','小张','小李','小明','小东'],\n",
    "       '成绩':[89,90,76,85,91]\n",
    "      }\n",
    "df2 = pd.DataFrame(dic,index=['a','b','c','d',1])\n",
    "df2.loc[1]\n",
    "df2.iloc[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200616</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200206</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.70</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.50</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.71</td>\n",
       "      <td>1.07</td>\n",
       "      <td>9.9907</td>\n",
       "      <td>256243.34</td>\n",
       "      <td>289982.744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200109</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.24</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.23</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.09</td>\n",
       "      <td>1.11</td>\n",
       "      <td>10.0090</td>\n",
       "      <td>204716.67</td>\n",
       "      <td>243318.704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20190909</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.16</td>\n",
       "      <td>0.92</td>\n",
       "      <td>10.0437</td>\n",
       "      <td>7829.00</td>\n",
       "      <td>7891.632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20190305</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.45</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.35</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.30</td>\n",
       "      <td>1.03</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>201177.91</td>\n",
       "      <td>218377.167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180418</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>11.84</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>1.17</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>258711.20</td>\n",
       "      <td>325185.223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170911</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>13.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170904</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20170721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
       "20200709    002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41  10.0071   \n",
       "20200616    002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00  10.0402   \n",
       "20200206    002747.SZ  10.70  11.78  10.50  11.78      10.71    1.07   9.9907   \n",
       "20200109    002747.SZ  11.24  12.20  11.23  12.20      11.09    1.11  10.0090   \n",
       "20190909    002747.SZ  10.08  10.08  10.08  10.08       9.16    0.92  10.0437   \n",
       "20190305    002747.SZ  10.45  11.33  10.35  11.33      10.30    1.03  10.0000   \n",
       "20180418    002747.SZ  11.84  12.87  11.70  12.87      11.70    1.17  10.0000   \n",
       "20170911    002747.SZ  13.50  14.82  13.37  14.82      13.47    1.35  10.0200   \n",
       "20170904    002747.SZ  12.22  13.53  12.22  13.53      12.30    1.23  10.0000   \n",
       "20170721    002747.SZ  10.30  11.12  10.28  11.12      10.11    1.01   9.9900   \n",
       "\n",
       "                  vol      amount  \n",
       "trade_date                         \n",
       "20200720    320102.62  530137.992  \n",
       "20200709    267772.91  395199.486  \n",
       "20200616    177673.09  188478.610  \n",
       "20200206    256243.34  289982.744  \n",
       "20200109    204716.67  243318.704  \n",
       "20190909      7829.00    7891.632  \n",
       "20190305    201177.91  218377.167  \n",
       "20180418    258711.20  325185.223  \n",
       "20170911    490574.54  708201.434  \n",
       "20170904    312931.88  409827.692  \n",
       "20170721    161723.79  177758.596  "
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['pct_chg'] > 9.9,:] # 输出所有涨停的数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### sort_values\n",
    "DataFrame.sort_values(by, \n",
    "               axis=0, \n",
    "               ascending=True, \n",
    "               inplace=False, \n",
    "               kind='quicksort', \n",
    "               na_position='last', # last，first；默认是last\n",
    "               ignore_index=False, \n",
    "               key=None)\n",
    "（1）by：表示根据什么字段或者索引进行排序，可以是一个或多个\n",
    "（2）axis：排序是在横轴还是纵轴，默认是纵轴axis=0\n",
    "（3）ascending：排序结果是升序还是降序，默认是升序\n",
    "（4）inplace：表示排序的结果是直接在原数据上的就地修改还是生成新的DatFrame\n",
    "（5）kind：表示使用排序的算法，快排quicksort,，归并mergesort， 堆排序heapsort，稳定排序stable ，默认是 ：快排 quicksort\n",
    "（6）na_position：缺失值的位置处理，默认是最后，另一个选择是首位\n",
    "（7）ignore_index：新生成的数据帧的索引是否重排，默认False（采用原数据的索引）\n",
    "（8）key：排序之前使用的函数\n",
    "————————————————\n",
    "版权声明：本文为CSDN博主「尤而小屋」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。\n",
    "原文链接：https://blog.csdn.net/qq_25443541/article/details/118697711"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20200722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.18</td>\n",
       "      <td>16.42</td>\n",
       "      <td>15.18</td>\n",
       "      <td>16.35</td>\n",
       "      <td>15.25</td>\n",
       "      <td>1.10</td>\n",
       "      <td>7.2131</td>\n",
       "      <td>189263.20</td>\n",
       "      <td>301483.183</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180725</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>16.16</td>\n",
       "      <td>16.26</td>\n",
       "      <td>15.81</td>\n",
       "      <td>15.90</td>\n",
       "      <td>16.35</td>\n",
       "      <td>-0.45</td>\n",
       "      <td>-2.7523</td>\n",
       "      <td>110424.70</td>\n",
       "      <td>176590.221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180718</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>15.60</td>\n",
       "      <td>16.15</td>\n",
       "      <td>15.37</td>\n",
       "      <td>15.69</td>\n",
       "      <td>15.52</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.1000</td>\n",
       "      <td>167440.56</td>\n",
       "      <td>263707.018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180717</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.75</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.52</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.82</td>\n",
       "      <td>5.5800</td>\n",
       "      <td>200447.43</td>\n",
       "      <td>307922.803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20200709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "20200722    002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   4.2998   \n",
       "20200721    002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   1.4143   \n",
       "20200720    002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   9.9806   \n",
       "20200723    002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44  -8.0223   \n",
       "20180724    002747.SZ  15.18  16.42  15.18  16.35      15.25    1.10   7.2131   \n",
       "20200724    002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31  -1.8776   \n",
       "20180725    002747.SZ  16.16  16.26  15.81  15.90      16.35   -0.45  -2.7523   \n",
       "20180718    002747.SZ  15.60  16.15  15.37  15.69      15.52    0.17   1.1000   \n",
       "20180717    002747.SZ  14.60  15.75  14.60  15.52      14.70    0.82   5.5800   \n",
       "20200709    002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41  10.0071   \n",
       "\n",
       "                  vol      amount  \n",
       "trade_date                         \n",
       "20200722    184201.74  325956.565  \n",
       "20200721    226621.76  390465.486  \n",
       "20200720    320102.62  530137.992  \n",
       "20200723    332693.07  561431.842  \n",
       "20180724    189263.20  301483.183  \n",
       "20200724    285487.23  460908.718  \n",
       "20180725    110424.70  176590.221  \n",
       "20180718    167440.56  263707.018  \n",
       "20180717    200447.43  307922.803  \n",
       "20200709    267772.91  395199.486  "
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sort_df = df.sort_values('close', ascending = False)\n",
    "  # 按照close，降序\n",
    "sort_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Apply 函数\n",
    "\n",
    "1. 因为apply函数极其灵活高效，甚至是重新定义了pandas的灵活；\n",
    "2. apply概念相对晦涩，需要结合具体案例去咀嚼和实践。\n",
    "\n",
    "该函数经常和df.groupby一起使用, df.groupby() 函数返回的对象是一系列键值对，其中键是分组的字段值，值是该字段值下的数据表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "002350.SZ\n",
      "     trade_date    ts_code  open  high   low  close  pre_close  change  \\\n",
      "552    20200729  002350.SZ  5.36  5.46  5.28   5.45       5.37    0.08   \n",
      "553    20200728  002350.SZ  5.35  5.42  5.31   5.37       5.35    0.02   \n",
      "554    20200727  002350.SZ  5.32  5.42  5.26   5.35       5.31    0.04   \n",
      "555    20200724  002350.SZ  5.47  5.54  5.31   5.31       5.49   -0.18   \n",
      "556    20200723  002350.SZ  5.48  5.49  5.32   5.49       5.51   -0.02   \n",
      "557    20200722  002350.SZ  5.48  5.54  5.44   5.51       5.50    0.01   \n",
      "558    20200721  002350.SZ  5.46  5.55  5.43   5.50       5.43    0.07   \n",
      "559    20200720  002350.SZ  5.31  5.47  5.30   5.43       5.27    0.16   \n",
      "560    20200717  002350.SZ  5.38  5.41  5.23   5.27       5.37   -0.10   \n",
      "561    20200716  002350.SZ  5.57  5.62  5.33   5.37       5.59   -0.22   \n",
      "562    20200715  002350.SZ  5.74  5.75  5.51   5.59       5.71   -0.12   \n",
      "563    20200714  002350.SZ  5.72  5.80  5.58   5.71       5.73   -0.02   \n",
      "564    20200713  002350.SZ  5.57  5.73  5.55   5.73       5.56    0.17   \n",
      "565    20200710  002350.SZ  5.74  5.74  5.56   5.56       5.74   -0.18   \n",
      "566    20200709  002350.SZ  5.68  5.77  5.61   5.74       5.66    0.08   \n",
      "567    20200708  002350.SZ  5.55  5.66  5.53   5.66       5.60    0.06   \n",
      "568    20200707  002350.SZ  5.58  5.67  5.48   5.60       5.57    0.03   \n",
      "569    20200706  002350.SZ  5.42  5.60  5.25   5.57       5.48    0.09   \n",
      "570    20200703  002350.SZ  5.89  5.89  5.46   5.48       5.35    0.13   \n",
      "571    20200701  002350.SZ  5.24  5.36  5.17   5.35       5.24    0.11   \n",
      "572    20200630  002350.SZ  5.28  5.30  5.20   5.24       5.27   -0.03   \n",
      "573    20200629  002350.SZ  5.21  5.32  5.13   5.27       5.27    0.00   \n",
      "574    20200624  002350.SZ  5.22  5.34  5.22   5.27       5.26    0.01   \n",
      "575    20200623  002350.SZ  5.22  5.36  5.22   5.26       5.28   -0.02   \n",
      "576    20200622  002350.SZ  5.17  5.33  5.14   5.28       5.19    0.09   \n",
      "577    20200619  002350.SZ  5.26  5.33  5.16   5.19       5.35   -0.16   \n",
      "578    20200618  002350.SZ  5.62  5.80  5.33   5.35       5.63   -0.28   \n",
      "579    20200617  002350.SZ  5.63  5.63  5.58   5.63       5.12    0.51   \n",
      "580    20200616  002350.SZ  5.07  5.14  5.07   5.12       5.08    0.04   \n",
      "581    20200615  002350.SZ  4.98  5.10  4.98   5.08       5.02    0.06   \n",
      "..          ...        ...   ...   ...   ...    ...        ...     ...   \n",
      "659    20200220  002350.SZ  6.07  6.23  5.94   6.20       6.08    0.12   \n",
      "660    20200219  002350.SZ  6.23  6.26  6.04   6.08       6.28   -0.20   \n",
      "661    20200218  002350.SZ  6.10  6.39  6.06   6.28       6.16    0.12   \n",
      "662    20200217  002350.SZ  6.00  6.17  5.95   6.16       6.06    0.10   \n",
      "663    20200214  002350.SZ  5.79  6.19  5.71   6.06       5.99    0.07   \n",
      "664    20200213  002350.SZ  6.20  6.44  5.99   5.99       5.92    0.07   \n",
      "665    20200212  002350.SZ  5.46  5.92  5.45   5.92       5.38    0.54   \n",
      "666    20200211  002350.SZ  5.47  5.49  5.37   5.38       5.47   -0.09   \n",
      "667    20200210  002350.SZ  5.32  5.47  5.27   5.47       5.32    0.15   \n",
      "668    20200207  002350.SZ  5.19  5.34  5.13   5.32       5.19    0.13   \n",
      "669    20200206  002350.SZ  5.11  5.22  5.10   5.19       5.14    0.05   \n",
      "670    20200205  002350.SZ  5.09  5.23  5.09   5.14       5.08    0.06   \n",
      "671    20200204  002350.SZ  4.72  5.23  4.72   5.08       5.24   -0.16   \n",
      "672    20200203  002350.SZ  5.24  5.24  5.24   5.24       5.82   -0.58   \n",
      "673    20200123  002350.SZ  5.98  6.02  5.74   5.82       5.99   -0.17   \n",
      "674    20200122  002350.SZ  5.92  6.07  5.83   5.99       6.00   -0.01   \n",
      "675    20200121  002350.SZ  6.16  6.17  5.96   6.00       6.15   -0.15   \n",
      "676    20200120  002350.SZ  6.08  6.16  6.05   6.15       6.10    0.05   \n",
      "677    20200117  002350.SZ  6.14  6.22  6.10   6.10       6.19   -0.09   \n",
      "678    20200116  002350.SZ  6.34  6.34  6.19   6.19       6.36   -0.17   \n",
      "679    20200115  002350.SZ  6.55  6.60  6.25   6.36       6.59   -0.23   \n",
      "680    20200114  002350.SZ  6.48  6.92  6.45   6.59       6.54    0.05   \n",
      "681    20200113  002350.SZ  6.50  6.62  6.41   6.54       6.71   -0.17   \n",
      "682    20200110  002350.SZ  6.05  6.71  5.97   6.71       6.10    0.61   \n",
      "683    20200109  002350.SZ  6.28  6.37  5.92   6.10       6.05    0.05   \n",
      "684    20200108  002350.SZ  6.20  6.52  6.01   6.05       5.93    0.12   \n",
      "685    20200107  002350.SZ  5.75  6.07  5.75   5.93       5.72    0.21   \n",
      "686    20200106  002350.SZ  5.65  5.74  5.65   5.72       5.69    0.03   \n",
      "687    20200103  002350.SZ  5.66  5.74  5.65   5.69       5.67    0.02   \n",
      "688    20200102  002350.SZ  5.65  5.68  5.60   5.67       5.60    0.07   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "552   1.4898   42830.66   23080.964  \n",
      "553   0.3738   37933.56   20376.337  \n",
      "554   0.7533   35949.53   19174.805  \n",
      "555  -3.2787   57973.46   31432.824  \n",
      "556  -0.3630   57060.82   30938.142  \n",
      "557   0.1818   49145.66   27078.577  \n",
      "558   1.2891   56019.20   30674.133  \n",
      "559   3.0361   48033.63   25856.039  \n",
      "560  -1.8622   53646.54   28390.846  \n",
      "561  -3.9356   73054.31   40000.315  \n",
      "562  -2.1016   79173.03   44460.553  \n",
      "563  -0.3490  111831.00   63394.296  \n",
      "564   3.0576  123024.10   69763.373  \n",
      "565  -3.1359  135707.84   76450.257  \n",
      "566   1.4134  148688.68   84883.122  \n",
      "567   1.0714  149852.01   84182.065  \n",
      "568   0.5386  186507.00  104337.444  \n",
      "569   1.6423  249966.20  135939.226  \n",
      "570   2.4299  252241.22  142854.970  \n",
      "571   2.0992   88327.32   46388.495  \n",
      "572  -0.5693   67916.14   35641.093  \n",
      "573   0.0000   69510.76   36361.599  \n",
      "574   0.1901   62936.11   33255.551  \n",
      "575  -0.3788   83361.45   44122.085  \n",
      "576   1.7341  107360.26   56026.992  \n",
      "577  -2.9907  148467.35   77403.732  \n",
      "578  -4.9734  268187.45  148390.675  \n",
      "579   9.9609  114740.08   64590.758  \n",
      "580   0.7874   31606.97   16144.006  \n",
      "581   1.1952   34298.04   17390.988  \n",
      "..       ...        ...         ...  \n",
      "659   1.9737  136050.11   83301.161  \n",
      "660  -3.1847  126933.50   78189.836  \n",
      "661   1.9481  174172.50  108591.280  \n",
      "662   1.6502  126684.60   76711.019  \n",
      "663   1.1686  160717.53   95509.993  \n",
      "664   1.1824  280371.90  173459.234  \n",
      "665  10.0372  155563.45   89984.065  \n",
      "666  -1.6453   39459.27   21350.565  \n",
      "667   2.8195   46564.08   25228.387  \n",
      "668   2.5048   53671.38   28235.062  \n",
      "669   0.9728   50352.95   26031.271  \n",
      "670   1.1811   47655.51   24578.871  \n",
      "671  -3.0534   77073.61   38838.267  \n",
      "672  -9.9656   11901.00    6236.124  \n",
      "673  -2.8381   48644.92   28534.580  \n",
      "674  -0.1667   48130.38   28812.409  \n",
      "675  -2.4390   57842.42   34871.239  \n",
      "676   0.8197   49417.89   30162.397  \n",
      "677  -1.4540   59659.40   36665.953  \n",
      "678  -2.6730   78552.90   48990.967  \n",
      "679  -3.4901  148040.02   93985.570  \n",
      "680   0.7645  211606.87  141252.242  \n",
      "681  -2.5335  260810.94  169894.614  \n",
      "682  10.0000  332168.68  215221.161  \n",
      "683   0.8264  140280.25   85630.713  \n",
      "684   2.0236  182015.88  111934.573  \n",
      "685   3.6713  101464.57   59886.982  \n",
      "686   0.5272   28396.10   16216.815  \n",
      "687   0.3527   23224.10   13208.640  \n",
      "688   1.2500   30157.31   17036.562  \n",
      "\n",
      "[137 rows x 11 columns]\n",
      "\n",
      "002660.SZ\n",
      "     trade_date    ts_code   open   high   low  close  pre_close  change  \\\n",
      "414    20200729  002660.SZ   8.73   8.93  8.61   8.92       8.72    0.20   \n",
      "415    20200728  002660.SZ   8.73   8.76  8.61   8.72       8.64    0.08   \n",
      "416    20200727  002660.SZ   8.80   8.85  8.51   8.64       8.80   -0.16   \n",
      "417    20200724  002660.SZ   9.13   9.19  8.72   8.80       9.14   -0.34   \n",
      "418    20200723  002660.SZ   9.30   9.33  8.90   9.14       9.39   -0.25   \n",
      "419    20200722  002660.SZ   9.45   9.45  9.24   9.39       9.55   -0.16   \n",
      "420    20200721  002660.SZ   9.64   9.68  9.43   9.55       9.67   -0.12   \n",
      "421    20200720  002660.SZ   9.42   9.72  9.42   9.67       9.42    0.25   \n",
      "422    20200717  002660.SZ   9.22   9.42  9.17   9.42       9.23    0.19   \n",
      "423    20200716  002660.SZ   9.63   9.70  9.12   9.23       9.59   -0.36   \n",
      "424    20200715  002660.SZ   9.92   9.93  9.55   9.59       9.95   -0.36   \n",
      "425    20200714  002660.SZ  10.01  10.01  9.63   9.95       9.98   -0.03   \n",
      "426    20200713  002660.SZ   9.34  10.15  9.34   9.98       9.30    0.68   \n",
      "427    20200710  002660.SZ   9.48   9.60  9.27   9.30       9.56   -0.26   \n",
      "428    20200709  002660.SZ   9.29   9.56  9.27   9.56       9.34    0.22   \n",
      "429    20200708  002660.SZ   9.20   9.37  9.12   9.34       9.22    0.12   \n",
      "430    20200707  002660.SZ   9.19   9.43  9.06   9.22       9.22    0.00   \n",
      "431    20200706  002660.SZ   9.06   9.36  9.03   9.22       9.03    0.19   \n",
      "432    20200703  002660.SZ   8.91   9.05  8.81   9.03       8.92    0.11   \n",
      "433    20200702  002660.SZ   8.96   8.99  8.78   8.92       8.90    0.02   \n",
      "434    20200701  002660.SZ   8.75   8.95  8.66   8.90       8.68    0.22   \n",
      "435    20200630  002660.SZ   8.54   8.69  8.50   8.68       8.47    0.21   \n",
      "436    20200629  002660.SZ   8.71   8.74  8.44   8.47       8.74   -0.27   \n",
      "437    20200624  002660.SZ   8.81   8.84  8.73   8.74       8.83   -0.09   \n",
      "438    20200623  002660.SZ   8.88   8.88  8.74   8.83       8.89   -0.06   \n",
      "439    20200622  002660.SZ   8.77   8.91  8.76   8.89       8.83    0.06   \n",
      "440    20200619  002660.SZ   8.85   8.97  8.76   8.83       8.85   -0.02   \n",
      "441    20200618  002660.SZ   8.77   8.88  8.71   8.85       8.77    0.08   \n",
      "442    20200617  002660.SZ   8.65   8.79  8.55   8.77       8.65    0.12   \n",
      "443    20200616  002660.SZ   8.57   8.67  8.55   8.65       8.52    0.13   \n",
      "..          ...        ...    ...    ...   ...    ...        ...     ...   \n",
      "522    20200220  002660.SZ   8.88   9.08  8.73   9.01       8.79    0.22   \n",
      "523    20200219  002660.SZ   8.82   9.04  8.75   8.79       8.89   -0.10   \n",
      "524    20200218  002660.SZ   8.73   8.95  8.60   8.89       8.68    0.21   \n",
      "525    20200217  002660.SZ   8.38   8.68  8.36   8.68       8.39    0.29   \n",
      "526    20200214  002660.SZ   8.25   8.43  8.19   8.39       8.33    0.06   \n",
      "527    20200213  002660.SZ   8.38   8.68  8.30   8.33       8.36   -0.03   \n",
      "528    20200212  002660.SZ   8.15   8.45  8.10   8.36       8.15    0.21   \n",
      "529    20200211  002660.SZ   8.18   8.25  8.05   8.15       8.18   -0.03   \n",
      "530    20200210  002660.SZ   7.90   8.22  7.86   8.18       7.97    0.21   \n",
      "531    20200207  002660.SZ   7.84   8.03  7.75   7.97       7.88    0.09   \n",
      "532    20200206  002660.SZ   7.60   7.90  7.59   7.88       7.68    0.20   \n",
      "533    20200205  002660.SZ   7.40   7.84  7.32   7.68       7.37    0.31   \n",
      "534    20200204  002660.SZ   7.15   7.57  7.15   7.37       7.94   -0.57   \n",
      "535    20200203  002660.SZ   7.94   7.94  7.94   7.94       8.82   -0.88   \n",
      "536    20200123  002660.SZ   9.32   9.42  8.65   8.82       9.38   -0.56   \n",
      "537    20200122  002660.SZ   9.62   9.62  9.31   9.38       9.47   -0.09   \n",
      "538    20200121  002660.SZ   9.48   9.86  9.30   9.47       9.44    0.03   \n",
      "539    20200120  002660.SZ   9.57   9.57  9.17   9.44       9.58   -0.14   \n",
      "540    20200117  002660.SZ   9.52   9.75  9.52   9.58       9.54    0.04   \n",
      "541    20200116  002660.SZ   9.70   9.75  9.49   9.54       9.65   -0.11   \n",
      "542    20200115  002660.SZ   9.58   9.77  9.53   9.65       9.58    0.07   \n",
      "543    20200114  002660.SZ   9.44   9.60  9.43   9.58       9.49    0.09   \n",
      "544    20200113  002660.SZ   9.45   9.60  9.42   9.49       9.45    0.04   \n",
      "545    20200110  002660.SZ   9.58   9.68  9.37   9.45       9.63   -0.18   \n",
      "546    20200109  002660.SZ   9.54   9.65  9.37   9.63       9.43    0.20   \n",
      "547    20200108  002660.SZ   9.20   9.74  9.11   9.43       9.25    0.18   \n",
      "548    20200107  002660.SZ   9.10   9.29  9.10   9.25       9.10    0.15   \n",
      "549    20200106  002660.SZ   8.82   9.18  8.82   9.10       8.92    0.18   \n",
      "550    20200103  002660.SZ   8.87   8.93  8.74   8.92       8.91    0.01   \n",
      "551    20200102  002660.SZ   8.81   8.93  8.81   8.91       8.77    0.14   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "414   2.2936   63362.62   55703.310  \n",
      "415   0.9259   42190.76   36687.481  \n",
      "416  -1.8182   61405.74   53229.802  \n",
      "417  -3.7199   82550.62   74058.606  \n",
      "418  -2.6624  104026.37   94870.030  \n",
      "419  -1.6754  123335.92  115340.074  \n",
      "420  -1.2410   79499.17   76035.845  \n",
      "421   2.6539   90421.78   86504.002  \n",
      "422   2.0585   66025.59   61378.138  \n",
      "423  -3.7539   99777.50   94482.580  \n",
      "424  -3.6181  122166.70  118566.497  \n",
      "425  -0.3006  194026.70  190091.791  \n",
      "426   7.3118  238799.63  232875.710  \n",
      "427  -2.7197  145443.12  137327.918  \n",
      "428   2.3555  176658.69  166216.617  \n",
      "429   1.3015  134123.30  124478.084  \n",
      "430   0.0000  201854.15  186605.060  \n",
      "431   2.1041  195591.69  180195.556  \n",
      "432   1.2332  116401.74  103899.166  \n",
      "433   0.2247  118484.52  105088.607  \n",
      "434   2.5346   99168.74   87832.805  \n",
      "435   2.4793   46586.21   40176.052  \n",
      "436  -3.0892   57413.00   49049.545  \n",
      "437  -1.0193   40843.00   35779.312  \n",
      "438  -0.6749   61655.01   54298.124  \n",
      "439   0.6795   63647.01   56208.118  \n",
      "440  -0.2260   58528.00   51712.504  \n",
      "441   0.9122   60374.18   53249.271  \n",
      "442   1.3873   66496.22   57822.402  \n",
      "443   1.5258   43321.00   37257.771  \n",
      "..       ...        ...         ...  \n",
      "522   2.5028  111483.00   99590.698  \n",
      "523  -1.1249  113896.47  100963.991  \n",
      "524   2.4194  120834.96  106109.088  \n",
      "525   3.4565   75018.00   64377.212  \n",
      "526   0.7203   80382.42   67075.946  \n",
      "527  -0.3589   85887.76   72545.698  \n",
      "528   2.5767   76544.70   63601.667  \n",
      "529  -0.3667   66437.45   54178.010  \n",
      "530   2.6349   73263.56   59214.956  \n",
      "531   1.1421   73541.16   57934.450  \n",
      "532   2.6042   92846.28   72055.257  \n",
      "533   4.2062  107798.92   82085.687  \n",
      "534  -7.1788  154079.17  113527.196  \n",
      "535  -9.9773    3248.00    2578.912  \n",
      "536  -5.9701  108702.64   97673.638  \n",
      "537  -0.9504   85526.44   80521.385  \n",
      "538   0.3178  115942.21  110831.806  \n",
      "539  -1.4614   96107.59   89681.241  \n",
      "540   0.4193   99932.26   96119.640  \n",
      "541  -1.1399   89791.28   86234.619  \n",
      "542   0.7307   90479.77   87316.704  \n",
      "543   0.9484   94698.81   89970.818  \n",
      "544   0.4233   93067.77   88432.424  \n",
      "545  -1.8692  111232.23  105464.058  \n",
      "546   2.1209  170923.38  162963.334  \n",
      "547   1.9459  209118.43  196190.989  \n",
      "548   1.6484  119248.88  109812.431  \n",
      "549   2.0179  141182.18  127321.875  \n",
      "550   0.1122   92711.84   82148.910  \n",
      "551   1.5964  107782.16   95686.697  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "002747.SZ\n",
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "138    20200729  002747.SZ  15.58  16.69  15.40  16.53      15.60    0.93   \n",
      "139    20200728  002747.SZ  15.68  15.98  15.22  15.60      15.38    0.22   \n",
      "140    20200727  002747.SZ  16.15  16.16  15.15  15.38      16.20   -0.82   \n",
      "141    20200724  002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
      "142    20200723  002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
      "143    20200722  002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   \n",
      "144    20200721  002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   \n",
      "145    20200720  002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   \n",
      "146    20200717  002747.SZ  14.86  15.80  14.80  15.43      14.87    0.56   \n",
      "147    20200716  002747.SZ  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
      "148    20200715  002747.SZ  15.40  15.60  14.80  15.23      15.20    0.03   \n",
      "149    20200714  002747.SZ  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
      "150    20200713  002747.SZ  14.97  15.43  14.75  15.32      15.12    0.20   \n",
      "151    20200710  002747.SZ  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
      "152    20200709  002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41   \n",
      "153    20200708  002747.SZ  13.03  14.40  13.03  14.09      13.09    1.00   \n",
      "154    20200707  002747.SZ  13.05  13.55  12.92  13.09      13.00    0.09   \n",
      "155    20200706  002747.SZ  12.97  13.16  12.78  13.00      12.90    0.10   \n",
      "156    20200703  002747.SZ  12.39  13.10  12.30  12.90      12.35    0.55   \n",
      "157    20200702  002747.SZ  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
      "158    20200701  002747.SZ  11.95  12.65  11.80  12.38      11.96    0.42   \n",
      "159    20200630  002747.SZ  11.62  12.15  11.51  11.96      11.58    0.38   \n",
      "160    20200629  002747.SZ  11.17  11.77  10.96  11.58      11.19    0.39   \n",
      "161    20200624  002747.SZ  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
      "162    20200623  002747.SZ  11.09  11.72  11.03  11.35      11.08    0.27   \n",
      "163    20200622  002747.SZ  11.10  11.31  10.93  11.08      11.05    0.03   \n",
      "164    20200619  002747.SZ  11.15  11.20  10.93  11.05      11.05    0.00   \n",
      "165    20200618  002747.SZ  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
      "166    20200617  002747.SZ  11.40  11.69  11.10  11.33      10.96    0.37   \n",
      "167    20200616  002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "246    20200220  002747.SZ  13.46  13.75  13.19  13.61      13.52    0.09   \n",
      "247    20200219  002747.SZ  12.82  14.03  12.60  13.52      12.82    0.70   \n",
      "248    20200218  002747.SZ  12.85  12.92  12.58  12.82      12.81    0.01   \n",
      "249    20200217  002747.SZ  12.51  12.84  12.38  12.81      12.57    0.24   \n",
      "250    20200214  002747.SZ  12.41  12.79  12.32  12.57      12.66   -0.09   \n",
      "251    20200213  002747.SZ  12.29  13.20  12.18  12.66      12.19    0.47   \n",
      "252    20200212  002747.SZ  11.93  12.32  11.90  12.19      12.03    0.16   \n",
      "253    20200211  002747.SZ  12.43  12.54  11.94  12.03      12.31   -0.28   \n",
      "254    20200210  002747.SZ  12.00  12.88  11.88  12.31      11.96    0.35   \n",
      "255    20200207  002747.SZ  11.95  12.56  11.70  11.96      11.78    0.18   \n",
      "256    20200206  002747.SZ  10.70  11.78  10.50  11.78      10.71    1.07   \n",
      "257    20200205  002747.SZ  10.45  10.88  10.30  10.71      10.59    0.12   \n",
      "258    20200204  002747.SZ   9.64  10.67   9.53  10.59       9.70    0.89   \n",
      "259    20200203  002747.SZ   9.70   9.84   9.70   9.70      10.78   -1.08   \n",
      "260    20200123  002747.SZ  11.54  11.59  10.50  10.78      11.62   -0.84   \n",
      "261    20200122  002747.SZ  11.67  11.84  11.00  11.62      11.88   -0.26   \n",
      "262    20200121  002747.SZ  11.90  12.16  11.76  11.88      11.88    0.00   \n",
      "263    20200120  002747.SZ  11.64  12.06  11.60  11.88      11.65    0.23   \n",
      "264    20200117  002747.SZ  11.83  11.90  11.52  11.65      11.84   -0.19   \n",
      "265    20200116  002747.SZ  11.73  11.96  11.63  11.84      11.73    0.11   \n",
      "266    20200115  002747.SZ  11.88  11.88  11.58  11.73      11.93   -0.20   \n",
      "267    20200114  002747.SZ  12.00  12.15  11.75  11.93      11.94   -0.01   \n",
      "268    20200113  002747.SZ  11.82  12.09  11.71  11.94      11.94    0.00   \n",
      "269    20200110  002747.SZ  12.26  12.30  11.74  11.94      12.20   -0.26   \n",
      "270    20200109  002747.SZ  11.24  12.20  11.23  12.20      11.09    1.11   \n",
      "271    20200108  002747.SZ  11.25  11.36  11.00  11.09      11.37   -0.28   \n",
      "272    20200107  002747.SZ  11.07  11.39  10.98  11.37      11.07    0.30   \n",
      "273    20200106  002747.SZ  11.11  11.23  10.92  11.07      11.27   -0.20   \n",
      "274    20200103  002747.SZ  11.36  11.48  11.21  11.27      11.29   -0.02   \n",
      "275    20200102  002747.SZ  11.29  11.48  11.25  11.29      11.26    0.03   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "138   5.9615  187518.29  300984.436  \n",
      "139   1.4304  125663.79  195823.200  \n",
      "140  -5.0617  228584.90  355934.528  \n",
      "141  -1.8776  285487.23  460908.718  \n",
      "142  -8.0223  332693.07  561431.842  \n",
      "143   4.2998  184201.74  325956.565  \n",
      "144   1.4143  226621.76  390465.486  \n",
      "145   9.9806  320102.62  530137.992  \n",
      "146   3.7660  199292.16  305435.914  \n",
      "147  -2.3638  229290.80  353556.481  \n",
      "148   0.1974  213356.58  323258.908  \n",
      "149  -0.7833  222269.86  340759.697  \n",
      "150   1.3228  184452.45  278886.698  \n",
      "151  -2.4516  218210.43  329484.318  \n",
      "152  10.0071  267772.91  395199.486  \n",
      "153   7.6394  293345.03  407198.381  \n",
      "154   0.6923  184150.75  243893.075  \n",
      "155   0.7752  241303.32  313084.240  \n",
      "156   4.4534  218369.18  278710.530  \n",
      "157  -0.2423  164501.68  201440.634  \n",
      "158   3.5117  228877.17  280866.551  \n",
      "159   3.2815  192286.30  228599.446  \n",
      "160   3.4853  207979.77  237171.977  \n",
      "161  -1.4097  124793.19  140215.789  \n",
      "162   2.4368  223595.75  256107.121  \n",
      "163   0.2715  145578.40  161746.863  \n",
      "164   0.0000  113959.89  125997.534  \n",
      "165  -2.4713  150478.58  168049.284  \n",
      "166   3.3759  278214.10  313691.260  \n",
      "167  10.0402  177673.09  188478.610  \n",
      "..       ...        ...         ...  \n",
      "246   0.6657  197563.81  265874.859  \n",
      "247   5.4602  286537.16  383271.057  \n",
      "248   0.0781  156361.54  199256.232  \n",
      "249   1.9093  188023.75  237659.619  \n",
      "250  -0.7109  144414.66  180683.591  \n",
      "251   3.8556  264140.73  337206.983  \n",
      "252   1.3300  180139.71  218717.738  \n",
      "253  -2.2746  197232.12  240087.746  \n",
      "254   2.9264  234882.29  290718.238  \n",
      "255   1.5280  256251.44  308776.651  \n",
      "256   9.9907  256243.34  289982.744  \n",
      "257   1.1331  161618.16  171293.788  \n",
      "258   9.1753  189291.61  191920.736  \n",
      "259 -10.0186   81077.56   78763.712  \n",
      "260  -7.2289  213356.49  232059.900  \n",
      "261  -2.1886  195031.20  222815.256  \n",
      "262   0.0000   90847.01  108418.376  \n",
      "263   1.9742   81398.09   96327.891  \n",
      "264  -1.6047   78974.70   92696.620  \n",
      "265   0.9378   71072.79   83983.817  \n",
      "266  -1.6764   81082.20   94838.296  \n",
      "267  -0.0838   82833.03   98709.606  \n",
      "268   0.0000  120355.39  143061.058  \n",
      "269  -2.1311  189932.45  227626.172  \n",
      "270  10.0090  204716.67  243318.704  \n",
      "271  -2.4626   96183.16  107562.563  \n",
      "272   2.7100  154765.09  173100.122  \n",
      "273  -1.7746  159696.02  176331.575  \n",
      "274  -0.1771   51916.83   58771.700  \n",
      "275   0.2664   77374.66   87830.416  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "300685.SZ\n",
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
      "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
      "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
      "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
      "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
      "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
      "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
      "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
      "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
      "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
      "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
      "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
      "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
      "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
      "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
      "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
      "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
      "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
      "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
      "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
      "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
      "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
      "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
      "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
      "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
      "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
      "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
      "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
      "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
      "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "108    20200220  300685.SZ  75.40  77.77  74.34  76.79      74.51    2.28   \n",
      "109    20200219  300685.SZ  76.20  77.00  74.50  74.51      76.55   -2.04   \n",
      "110    20200218  300685.SZ  73.97  77.40  73.06  76.55      73.78    2.77   \n",
      "111    20200217  300685.SZ  70.30  73.79  70.01  73.78      70.51    3.27   \n",
      "112    20200214  300685.SZ  71.02  71.85  69.91  70.51      71.85   -1.34   \n",
      "113    20200213  300685.SZ  73.59  73.60  70.67  71.85      73.59   -1.74   \n",
      "114    20200212  300685.SZ  71.98  73.70  71.21  73.59      71.87    1.72   \n",
      "115    20200211  300685.SZ  73.21  73.99  71.31  71.87      72.86   -0.99   \n",
      "116    20200210  300685.SZ  71.40  72.86  69.96  72.86      71.00    1.86   \n",
      "117    20200207  300685.SZ  70.40  72.24  69.50  71.00      70.97    0.03   \n",
      "118    20200206  300685.SZ  69.00  72.50  67.52  70.97      68.50    2.47   \n",
      "119    20200205  300685.SZ  68.85  71.00  67.09  68.50      68.33    0.17   \n",
      "120    20200204  300685.SZ  68.00  71.48  66.60  68.33      66.25    2.08   \n",
      "121    20200203  300685.SZ  64.62  70.00  64.62  66.25      71.50   -5.25   \n",
      "122    20200123  300685.SZ  72.98  73.88  70.30  71.50      73.49   -1.99   \n",
      "123    20200122  300685.SZ  71.15  74.19  70.72  73.49      72.46    1.03   \n",
      "124    20200121  300685.SZ  72.40  74.61  71.79  72.46      72.50   -0.04   \n",
      "125    20200120  300685.SZ  71.50  73.79  71.24  72.50      72.89   -0.39   \n",
      "126    20200117  300685.SZ  72.13  73.50  71.30  72.89      72.12    0.77   \n",
      "127    20200116  300685.SZ  69.00  72.67  68.40  72.12      69.00    3.12   \n",
      "128    20200115  300685.SZ  68.33  69.34  67.29  69.00      68.08    0.92   \n",
      "129    20200114  300685.SZ  69.00  70.23  67.79  68.08      70.20   -2.12   \n",
      "130    20200113  300685.SZ  69.49  70.34  68.18  70.20      69.14    1.06   \n",
      "131    20200110  300685.SZ  69.11  69.47  68.38  69.14      68.95    0.19   \n",
      "132    20200109  300685.SZ  67.50  69.39  66.89  68.95      66.87    2.08   \n",
      "133    20200108  300685.SZ  67.53  67.97  66.60  66.87      67.50   -0.63   \n",
      "134    20200107  300685.SZ  64.83  67.57  64.39  67.50      64.83    2.67   \n",
      "135    20200106  300685.SZ  66.90  66.90  64.25  64.83      66.97   -2.14   \n",
      "136    20200103  300685.SZ  66.48  67.50  66.48  66.97      66.77    0.20   \n",
      "137    20200102  300685.SZ  67.00  67.47  65.78  66.77      66.82   -0.05   \n",
      "\n",
      "     pct_chg       vol      amount  \n",
      "0     4.3701  48231.39  378538.641  \n",
      "1     1.1012  45510.24  349243.253  \n",
      "2     6.1699  40116.85  298893.827  \n",
      "3    -8.5534  45608.24  338125.593  \n",
      "4     0.9493  46867.92  367416.632  \n",
      "5     4.1300  36207.00  275623.622  \n",
      "6     4.3521  29076.21  212671.328  \n",
      "7    -0.0424  34827.97  242427.871  \n",
      "8     2.0614  37857.31  265442.956  \n",
      "9    -9.9909  51816.84  377971.397  \n",
      "10    1.7023  37215.87  286581.438  \n",
      "11   -1.9537  35784.18  271008.151  \n",
      "12    4.3050  43903.29  333576.063  \n",
      "13    0.6793  46695.92  347164.239  \n",
      "14    3.4289  54826.16  399887.616  \n",
      "15   -1.2901  34518.84  246140.556  \n",
      "16    1.3924  59030.63  423139.793  \n",
      "17   -0.9473  49749.56  351523.864  \n",
      "18   -0.0139  44320.35  317241.463  \n",
      "19   -4.2800  49920.29  363465.213  \n",
      "20   -2.5468  47894.86  358618.948  \n",
      "21    0.5750  40548.34  315525.626  \n",
      "22    7.1859  47526.42  354810.200  \n",
      "23    0.2669  40287.73  286346.167  \n",
      "24    6.2687  57229.92  404187.925  \n",
      "25    0.0597  39436.54  264723.283  \n",
      "26    4.2341  43957.20  292223.754  \n",
      "27   -4.7026  48086.17  312153.061  \n",
      "28    1.2466  55550.50  376356.761  \n",
      "29    5.4315  62299.90  409306.837  \n",
      "..       ...       ...         ...  \n",
      "108   3.0600  30280.41  231242.088  \n",
      "109  -2.6649  19756.40  149537.734  \n",
      "110   3.7544  34274.17  258686.548  \n",
      "111   4.6376  27209.04  196803.405  \n",
      "112  -1.8650  20343.83  144420.399  \n",
      "113  -2.3645  26674.79  190896.996  \n",
      "114   2.3932  25678.04  186308.143  \n",
      "115  -1.3588  19281.82  138777.567  \n",
      "116   2.6197  24315.64  174276.638  \n",
      "117   0.0423  21914.73  155197.042  \n",
      "118   3.6058  31288.24  220797.919  \n",
      "119   0.2488  29879.77  205348.741  \n",
      "120   3.1396  25455.97  175732.051  \n",
      "121  -7.3427  18990.64  127046.187  \n",
      "122  -2.7079  14670.38  105782.775  \n",
      "123   1.4215  15989.18  116601.304  \n",
      "124  -0.0552  17150.28  125361.676  \n",
      "125  -0.5351  18302.43  131931.476  \n",
      "126   1.0677  14616.00  106157.056  \n",
      "127   4.5217  24199.46  172582.069  \n",
      "128   1.3514   9219.60   63364.993  \n",
      "129  -3.0199  15749.27  107931.580  \n",
      "130   1.5331  12982.12   90079.785  \n",
      "131   0.2756   7331.40   50582.956  \n",
      "132   3.1105  15907.71  109182.689  \n",
      "133  -0.9333  10127.58   67835.534  \n",
      "134   4.1185  22472.05  149042.950  \n",
      "135  -3.1955  20209.69  131276.340  \n",
      "136   0.2995   9629.20   64442.805  \n",
      "137  -0.0748  11580.00   77024.479  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n",
      "603288.SH\n",
      "     trade_date    ts_code    open    high     low   close  pre_close  change  \\\n",
      "276    20200729  603288.SH  145.14  148.80  143.79  148.60     146.19    2.41   \n",
      "277    20200728  603288.SH  145.90  152.00  145.00  146.19     144.99    1.20   \n",
      "278    20200727  603288.SH  138.43  145.42  136.83  144.99     137.07    7.92   \n",
      "279    20200724  603288.SH  140.70  140.97  136.25  137.07     140.70   -3.63   \n",
      "280    20200723  603288.SH  134.99  142.43  134.00  140.70     135.88    4.82   \n",
      "281    20200722  603288.SH  134.18  136.87  133.10  135.88     135.54    0.34   \n",
      "282    20200721  603288.SH  132.00  135.99  130.24  135.54     130.95    4.59   \n",
      "283    20200720  603288.SH  131.45  132.97  128.40  130.95     130.10    0.85   \n",
      "284    20200717  603288.SH  127.00  131.31  127.00  130.10     127.00    3.10   \n",
      "285    20200716  603288.SH  133.80  133.80  126.00  127.00     134.16   -7.16   \n",
      "286    20200715  603288.SH  131.20  135.75  130.02  134.16     130.60    3.56   \n",
      "287    20200714  603288.SH  131.34  132.35  128.70  130.60     131.37   -0.77   \n",
      "288    20200713  603288.SH  130.00  132.48  129.38  131.37     130.24    1.13   \n",
      "289    20200710  603288.SH  127.77  132.40  127.50  130.24     128.64    1.60   \n",
      "290    20200709  603288.SH  127.77  129.08  126.60  128.64     127.77    0.87   \n",
      "291    20200708  603288.SH  129.10  129.86  126.60  127.77     128.05   -0.28   \n",
      "292    20200707  603288.SH  124.45  131.77  124.01  128.05     124.44    3.61   \n",
      "293    20200706  603288.SH  123.55  125.50  123.33  124.44     124.35    0.09   \n",
      "294    20200703  603288.SH  124.01  124.77  122.80  124.35     124.00    0.35   \n",
      "295    20200702  603288.SH  127.50  127.98  123.00  124.00     125.00   -1.00   \n",
      "296    20200701  603288.SH  124.00  125.29  122.99  125.00     124.40    0.60   \n",
      "297    20200630  603288.SH  124.64  124.78  122.86  124.40     124.65   -0.25   \n",
      "298    20200629  603288.SH  123.79  125.30  122.62  124.65     123.80    0.85   \n",
      "299    20200624  603288.SH  121.90  124.00  121.00  123.80     121.30    2.50   \n",
      "300    20200623  603288.SH  118.15  121.34  117.81  121.30     117.89    3.41   \n",
      "301    20200622  603288.SH  119.50  119.87  117.22  117.89     119.39   -1.50   \n",
      "302    20200619  603288.SH  117.00  120.50  116.82  119.39     116.63    2.76   \n",
      "303    20200618  603288.SH  116.30  116.88  115.06  116.63     115.85    0.78   \n",
      "304    20200617  603288.SH  117.00  117.00  113.52  115.85     116.22   -0.37   \n",
      "305    20200616  603288.SH  115.25  116.92  114.27  116.22     114.01    2.21   \n",
      "..          ...        ...     ...     ...     ...     ...        ...     ...   \n",
      "384    20200220  603288.SH  104.00  106.38  103.40  105.88     103.84    2.04   \n",
      "385    20200219  603288.SH  103.00  104.45  102.90  103.84     103.38    0.46   \n",
      "386    20200218  603288.SH  104.90  105.29  102.87  103.38     105.37   -1.99   \n",
      "387    20200217  603288.SH  105.15  106.19  104.50  105.37     104.70    0.67   \n",
      "388    20200214  603288.SH  104.89  105.93  104.08  104.70     104.70    0.00   \n",
      "389    20200213  603288.SH  107.00  107.37  104.50  104.70     107.08   -2.38   \n",
      "390    20200212  603288.SH  106.30  108.29  106.30  107.08     107.00    0.08   \n",
      "391    20200211  603288.SH  105.00  107.03  105.00  107.00     105.80    1.20   \n",
      "392    20200210  603288.SH  105.60  106.57  105.10  105.80     106.50   -0.70   \n",
      "393    20200207  603288.SH  104.58  107.08  103.48  106.50     105.25    1.25   \n",
      "394    20200206  603288.SH  104.17  106.30  102.50  105.25     104.00    1.25   \n",
      "395    20200205  603288.SH  102.68  104.20  100.70  104.00     102.68    1.32   \n",
      "396    20200204  603288.SH  102.50  104.04  100.80  102.68     101.83    0.85   \n",
      "397    20200203  603288.SH   96.49  102.04   96.49  101.83     107.21   -5.38   \n",
      "398    20200123  603288.SH  109.95  109.95  106.02  107.21     109.74   -2.53   \n",
      "399    20200122  603288.SH  111.60  111.60  109.02  109.74     111.95   -2.21   \n",
      "400    20200121  603288.SH  111.30  112.70  109.00  111.95     112.05   -0.10   \n",
      "401    20200120  603288.SH  110.08  112.45  108.76  112.05     109.86    2.19   \n",
      "402    20200117  603288.SH  108.48  109.94  107.27  109.86     108.49    1.37   \n",
      "403    20200116  603288.SH  108.00  108.51  106.17  108.49     107.37    1.12   \n",
      "404    20200115  603288.SH  105.90  107.89  105.50  107.37     105.90    1.47   \n",
      "405    20200114  603288.SH  108.88  109.50  105.80  105.90     108.30   -2.40   \n",
      "406    20200113  603288.SH  108.76  108.94  107.40  108.30     107.96    0.34   \n",
      "407    20200110  603288.SH  108.30  108.66  107.00  107.96     107.79    0.17   \n",
      "408    20200109  603288.SH  106.45  108.00  106.45  107.79     106.17    1.62   \n",
      "409    20200108  603288.SH  106.00  106.73  105.02  106.17     106.00    0.17   \n",
      "410    20200107  603288.SH  103.83  106.00  103.83  106.00     103.62    2.38   \n",
      "411    20200106  603288.SH  104.72  104.98  103.31  103.62     105.41   -1.79   \n",
      "412    20200103  603288.SH  108.50  108.60  104.00  105.41     108.00   -2.59   \n",
      "413    20200102  603288.SH  107.75  109.91  107.58  108.00     107.51    0.49   \n",
      "\n",
      "     pct_chg        vol       amount  \n",
      "276   1.6485   54572.25   798579.731  \n",
      "277   0.8276   77218.48  1141693.510  \n",
      "278   5.7781   72742.60  1037050.820  \n",
      "279  -2.5800   64806.80   896881.888  \n",
      "280   3.5472   82828.48  1156858.738  \n",
      "281   0.2508   53841.98   729364.010  \n",
      "282   3.5052   59911.70   806762.766  \n",
      "283   0.6533   46782.34   611273.935  \n",
      "284   2.4409   53468.21   692144.968  \n",
      "285  -5.3369   86302.76  1115289.240  \n",
      "286   2.7259   79041.38  1052996.487  \n",
      "287  -0.5861   51249.03   669211.267  \n",
      "288   0.8676   60639.27   797623.555  \n",
      "289   1.2438   60832.80   793420.997  \n",
      "290   0.6809   51845.63   662460.070  \n",
      "291  -0.2187   63822.19   814191.193  \n",
      "292   2.9010  108624.68  1393183.715  \n",
      "293   0.0724   82996.00  1031734.270  \n",
      "294   0.2823   51844.65   642209.904  \n",
      "295  -0.8000   90276.82  1128277.402  \n",
      "296   0.4823   42430.30   527650.641  \n",
      "297  -0.2006   37871.06   468710.066  \n",
      "298   0.6866   50701.97   628353.233  \n",
      "299   2.0610   55898.73   686368.486  \n",
      "300   2.8925   65239.66   783362.708  \n",
      "301  -1.2564   47540.56   561091.361  \n",
      "302   2.3665   72058.18   859236.308  \n",
      "303   0.6733   40049.71   465653.003  \n",
      "304  -0.3184   56720.06   650943.201  \n",
      "305   1.9384   62025.89   718722.602  \n",
      "..       ...        ...          ...  \n",
      "384   1.9646   47228.15   498134.688  \n",
      "385   0.4450   31246.50   324778.642  \n",
      "386  -1.8886   49676.82   514002.851  \n",
      "387   0.6399   26878.00   283022.689  \n",
      "388   0.0000   22814.55   239519.343  \n",
      "389  -2.2226   33183.20   349478.085  \n",
      "390   0.0748   29767.54   318543.203  \n",
      "391   1.1342   35313.92   375073.575  \n",
      "392  -0.6573   28737.97   304402.656  \n",
      "393   1.1876   36723.57   385546.260  \n",
      "394   1.2019   48135.25   504796.299  \n",
      "395   1.2855   47074.85   481037.932  \n",
      "396   0.8347   59751.65   610398.849  \n",
      "397  -5.0182   84424.04   838318.029  \n",
      "398  -2.3054   46158.31   496066.130  \n",
      "399  -1.9741   39103.60   428874.296  \n",
      "400  -0.0892   42660.84   474806.222  \n",
      "401   1.9934   42974.92   478950.689  \n",
      "402   1.2628   38986.25   425364.039  \n",
      "403   1.0431   32623.37   350442.761  \n",
      "404   1.3881   31287.76   334933.935  \n",
      "405  -2.2161   39365.89   420855.325  \n",
      "406   0.3149   26702.57   288812.722  \n",
      "407   0.1577   21766.19   234674.772  \n",
      "408   1.5259   35130.86   377460.716  \n",
      "409   0.1604   25883.10   274000.681  \n",
      "410   2.2969   40213.70   423924.757  \n",
      "411  -1.6981   50322.18   524145.305  \n",
      "412  -2.3981   58963.77   623049.159  \n",
      "413   0.4558   40725.22   442407.988  \n",
      "\n",
      "[138 rows x 11 columns]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "df\n",
    "grouped = df.groupby('ts_code')\n",
    "#list(grouped)\n",
    "for key, value in grouped:\n",
    "    print(key)\n",
    "    print(value)\n",
    "    print(\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = 'F:\\\\hongdou\\\\1111111111111111课程\\\\Python\\\\python_course-master\\\\BasicSession\\\\multi_stock_data.csv'\n",
    "df = pd.read_csv(path)\n",
    "df\n",
    "grouped = df.groupby('ts_code')\n",
    "list(grouped)\n",
    "for key, value in grouped:\n",
    "    print(key)\n",
    "    print(value)\n",
    "    print(\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "例子：\n",
    "Pandas-分组：df.groupby();\n",
    "https://zhuanlan.zhihu.com/p/149126583   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "转换成列表的形式后，可以看到，列表由5个元组组成，每个元组中，第一个元素是组别（这里是按照ts_code进行分组），第二个元素的是对应组别下的DataFrame.\n",
    "总结来说，groupby的过程就是将原有的DataFrame按照groupby的字段（这里是ts_code），划分为若干个分组DataFrame，被分为多少个组就有多少个分组DataFrame。所以说，在groupby之后的一系列操作（如agg、apply等），均是基于子DataFrame的操作。理解了这点，也就基本摸清了Pandas中groupby操作的主要原理。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### agg\n",
    "\n",
    "**聚合操作**是groupby后非常常见的操作。聚合操作可以用来求和、均值、最大值、最小值等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.683650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.331304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.520072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>75.513623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>114.868841</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close        open\n",
       "ts_code                          \n",
       "002350.SZ    5.705693    5.683650\n",
       "002660.SZ    9.363551    9.331304\n",
       "002747.SZ   11.567029   11.520072\n",
       "300685.SZ   75.799058   75.513623\n",
       "603288.SH  115.442319  114.868841"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_perform = df.groupby('ts_code')['close','open'].agg('mean')\n",
    "mean_perform\n",
    "  # python3 关于agg函数的用法（一般与groupby函数连用）：\n",
    "  #   https://blog.csdn.net/qq_24753293/article/details/80323487"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>73.995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>113.960</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close     open\n",
       "ts_code                       \n",
       "002350.SZ    5.705693    5.660\n",
       "002660.SZ    9.363551    9.280\n",
       "002747.SZ   11.567029   11.080\n",
       "300685.SZ   75.799058   73.995\n",
       "603288.SH  115.442319  113.960"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "some_perform = df.groupby('ts_code')['close','open'].agg({'close':'mean', 'open':'median'})\n",
    "some_perform\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"3\" halign=\"left\">close</th>\n",
       "      <th colspan=\"3\" halign=\"left\">open</th>\n",
       "      <th colspan=\"3\" halign=\"left\">pct_chg</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>4.89</td>\n",
       "      <td>7.09</td>\n",
       "      <td>5.705693</td>\n",
       "      <td>4.72</td>\n",
       "      <td>6.95</td>\n",
       "      <td>5.683650</td>\n",
       "      <td>-10.0471</td>\n",
       "      <td>10.0372</td>\n",
       "      <td>0.109669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>7.37</td>\n",
       "      <td>11.51</td>\n",
       "      <td>9.363551</td>\n",
       "      <td>7.15</td>\n",
       "      <td>11.40</td>\n",
       "      <td>9.331304</td>\n",
       "      <td>-10.0200</td>\n",
       "      <td>9.9886</td>\n",
       "      <td>0.070099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>9.25</td>\n",
       "      <td>17.95</td>\n",
       "      <td>11.567029</td>\n",
       "      <td>9.10</td>\n",
       "      <td>17.80</td>\n",
       "      <td>11.520072</td>\n",
       "      <td>-10.0186</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>0.350140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>64.24</td>\n",
       "      <td>94.98</td>\n",
       "      <td>75.799058</td>\n",
       "      <td>63.63</td>\n",
       "      <td>97.15</td>\n",
       "      <td>75.513623</td>\n",
       "      <td>-9.9909</td>\n",
       "      <td>7.1859</td>\n",
       "      <td>0.472690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>93.40</td>\n",
       "      <td>148.60</td>\n",
       "      <td>115.442319</td>\n",
       "      <td>92.47</td>\n",
       "      <td>145.90</td>\n",
       "      <td>114.868841</td>\n",
       "      <td>-5.3369</td>\n",
       "      <td>10.0009</td>\n",
       "      <td>0.399237</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           close                       open                      pct_chg  \\\n",
       "             min     max        mean    min     max        mean      min   \n",
       "ts_code                                                                    \n",
       "002350.SZ   4.89    7.09    5.705693   4.72    6.95    5.683650 -10.0471   \n",
       "002660.SZ   7.37   11.51    9.363551   7.15   11.40    9.331304 -10.0200   \n",
       "002747.SZ   9.25   17.95   11.567029   9.10   17.80   11.520072 -10.0186   \n",
       "300685.SZ  64.24   94.98   75.799058  63.63   97.15   75.513623  -9.9909   \n",
       "603288.SH  93.40  148.60  115.442319  92.47  145.90  114.868841  -5.3369   \n",
       "\n",
       "                              \n",
       "               max      mean  \n",
       "ts_code                       \n",
       "002350.SZ  10.0372  0.109669  \n",
       "002660.SZ   9.9886  0.070099  \n",
       "002747.SZ  10.0402  0.350140  \n",
       "300685.SZ   7.1859  0.472690  \n",
       "603288.SH  10.0009  0.399237  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "best_perfrom = df.groupby('ts_code')['close','open','pct_chg'].agg(['min','max','mean'])\n",
    "best_perfrom"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### transform\n",
    "对transform而言，则会对每一条数据求得相应的结果，同一组内的样本会有相同的值，组内求完均值后会按照原索引的顺序返回结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>avg_close</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20200729</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.88</td>\n",
       "      <td>80.50</td>\n",
       "      <td>75.22</td>\n",
       "      <td>79.53</td>\n",
       "      <td>76.20</td>\n",
       "      <td>3.33</td>\n",
       "      <td>4.3701</td>\n",
       "      <td>48231.39</td>\n",
       "      <td>378538.641</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20200728</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.24</td>\n",
       "      <td>79.43</td>\n",
       "      <td>74.99</td>\n",
       "      <td>76.20</td>\n",
       "      <td>75.37</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.1012</td>\n",
       "      <td>45510.24</td>\n",
       "      <td>349243.253</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20200727</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.84</td>\n",
       "      <td>75.99</td>\n",
       "      <td>71.09</td>\n",
       "      <td>75.37</td>\n",
       "      <td>70.99</td>\n",
       "      <td>4.38</td>\n",
       "      <td>6.1699</td>\n",
       "      <td>40116.85</td>\n",
       "      <td>298893.827</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20200724</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.56</td>\n",
       "      <td>78.44</td>\n",
       "      <td>70.00</td>\n",
       "      <td>70.99</td>\n",
       "      <td>77.63</td>\n",
       "      <td>-6.64</td>\n",
       "      <td>-8.5534</td>\n",
       "      <td>45608.24</td>\n",
       "      <td>338125.593</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20200723</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.70</td>\n",
       "      <td>80.80</td>\n",
       "      <td>76.41</td>\n",
       "      <td>77.63</td>\n",
       "      <td>76.90</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.9493</td>\n",
       "      <td>46867.92</td>\n",
       "      <td>367416.632</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20200722</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.83</td>\n",
       "      <td>77.59</td>\n",
       "      <td>72.92</td>\n",
       "      <td>76.90</td>\n",
       "      <td>73.85</td>\n",
       "      <td>3.05</td>\n",
       "      <td>4.1300</td>\n",
       "      <td>36207.00</td>\n",
       "      <td>275623.622</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20200721</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.61</td>\n",
       "      <td>74.50</td>\n",
       "      <td>69.50</td>\n",
       "      <td>73.85</td>\n",
       "      <td>70.77</td>\n",
       "      <td>3.08</td>\n",
       "      <td>4.3521</td>\n",
       "      <td>29076.21</td>\n",
       "      <td>212671.328</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20200720</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.98</td>\n",
       "      <td>71.99</td>\n",
       "      <td>67.18</td>\n",
       "      <td>70.77</td>\n",
       "      <td>70.80</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.0424</td>\n",
       "      <td>34827.97</td>\n",
       "      <td>242427.871</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20200717</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>69.76</td>\n",
       "      <td>72.13</td>\n",
       "      <td>68.64</td>\n",
       "      <td>70.80</td>\n",
       "      <td>69.37</td>\n",
       "      <td>1.43</td>\n",
       "      <td>2.0614</td>\n",
       "      <td>37857.31</td>\n",
       "      <td>265442.956</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20200716</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>78.00</td>\n",
       "      <td>78.26</td>\n",
       "      <td>69.36</td>\n",
       "      <td>69.37</td>\n",
       "      <td>77.07</td>\n",
       "      <td>-7.70</td>\n",
       "      <td>-9.9909</td>\n",
       "      <td>51816.84</td>\n",
       "      <td>377971.397</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20200715</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.60</td>\n",
       "      <td>78.68</td>\n",
       "      <td>75.49</td>\n",
       "      <td>77.07</td>\n",
       "      <td>75.78</td>\n",
       "      <td>1.29</td>\n",
       "      <td>1.7023</td>\n",
       "      <td>37215.87</td>\n",
       "      <td>286581.438</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20200714</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.73</td>\n",
       "      <td>78.00</td>\n",
       "      <td>73.00</td>\n",
       "      <td>75.78</td>\n",
       "      <td>77.29</td>\n",
       "      <td>-1.51</td>\n",
       "      <td>-1.9537</td>\n",
       "      <td>35784.18</td>\n",
       "      <td>271008.151</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20200713</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.98</td>\n",
       "      <td>77.35</td>\n",
       "      <td>74.30</td>\n",
       "      <td>77.29</td>\n",
       "      <td>74.10</td>\n",
       "      <td>3.19</td>\n",
       "      <td>4.3050</td>\n",
       "      <td>43903.29</td>\n",
       "      <td>333576.063</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20200710</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.75</td>\n",
       "      <td>75.86</td>\n",
       "      <td>72.90</td>\n",
       "      <td>74.10</td>\n",
       "      <td>73.60</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.6793</td>\n",
       "      <td>46695.92</td>\n",
       "      <td>347164.239</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20200709</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>73.65</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.60</td>\n",
       "      <td>71.16</td>\n",
       "      <td>2.44</td>\n",
       "      <td>3.4289</td>\n",
       "      <td>54826.16</td>\n",
       "      <td>399887.616</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20200708</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.27</td>\n",
       "      <td>72.74</td>\n",
       "      <td>70.35</td>\n",
       "      <td>71.16</td>\n",
       "      <td>72.09</td>\n",
       "      <td>-0.93</td>\n",
       "      <td>-1.2901</td>\n",
       "      <td>34518.84</td>\n",
       "      <td>246140.556</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20200707</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.43</td>\n",
       "      <td>68.70</td>\n",
       "      <td>72.09</td>\n",
       "      <td>71.10</td>\n",
       "      <td>0.99</td>\n",
       "      <td>1.3924</td>\n",
       "      <td>59030.63</td>\n",
       "      <td>423139.793</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>20200706</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.02</td>\n",
       "      <td>71.79</td>\n",
       "      <td>68.88</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.78</td>\n",
       "      <td>-0.68</td>\n",
       "      <td>-0.9473</td>\n",
       "      <td>49749.56</td>\n",
       "      <td>351523.864</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>20200703</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.50</td>\n",
       "      <td>73.10</td>\n",
       "      <td>70.00</td>\n",
       "      <td>71.78</td>\n",
       "      <td>71.79</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.0139</td>\n",
       "      <td>44320.35</td>\n",
       "      <td>317241.463</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20200702</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.13</td>\n",
       "      <td>75.97</td>\n",
       "      <td>71.25</td>\n",
       "      <td>71.79</td>\n",
       "      <td>75.00</td>\n",
       "      <td>-3.21</td>\n",
       "      <td>-4.2800</td>\n",
       "      <td>49920.29</td>\n",
       "      <td>363465.213</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>20200701</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>77.12</td>\n",
       "      <td>78.26</td>\n",
       "      <td>72.39</td>\n",
       "      <td>75.00</td>\n",
       "      <td>76.96</td>\n",
       "      <td>-1.96</td>\n",
       "      <td>-2.5468</td>\n",
       "      <td>47894.86</td>\n",
       "      <td>358618.948</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>20200630</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.30</td>\n",
       "      <td>79.95</td>\n",
       "      <td>75.58</td>\n",
       "      <td>76.96</td>\n",
       "      <td>76.52</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.5750</td>\n",
       "      <td>40548.34</td>\n",
       "      <td>315525.626</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>20200629</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.90</td>\n",
       "      <td>77.39</td>\n",
       "      <td>70.33</td>\n",
       "      <td>76.52</td>\n",
       "      <td>71.39</td>\n",
       "      <td>5.13</td>\n",
       "      <td>7.1859</td>\n",
       "      <td>47526.42</td>\n",
       "      <td>354810.200</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>20200624</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.91</td>\n",
       "      <td>69.80</td>\n",
       "      <td>71.39</td>\n",
       "      <td>71.20</td>\n",
       "      <td>0.19</td>\n",
       "      <td>0.2669</td>\n",
       "      <td>40287.73</td>\n",
       "      <td>286346.167</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>20200623</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.80</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.20</td>\n",
       "      <td>67.00</td>\n",
       "      <td>4.20</td>\n",
       "      <td>6.2687</td>\n",
       "      <td>57229.92</td>\n",
       "      <td>404187.925</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>20200622</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.91</td>\n",
       "      <td>68.40</td>\n",
       "      <td>66.01</td>\n",
       "      <td>67.00</td>\n",
       "      <td>66.96</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>39436.54</td>\n",
       "      <td>264723.283</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>20200619</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>65.37</td>\n",
       "      <td>67.45</td>\n",
       "      <td>64.30</td>\n",
       "      <td>66.96</td>\n",
       "      <td>64.24</td>\n",
       "      <td>2.72</td>\n",
       "      <td>4.2341</td>\n",
       "      <td>43957.20</td>\n",
       "      <td>292223.754</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>20200618</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.99</td>\n",
       "      <td>67.66</td>\n",
       "      <td>63.72</td>\n",
       "      <td>64.24</td>\n",
       "      <td>67.41</td>\n",
       "      <td>-3.17</td>\n",
       "      <td>-4.7026</td>\n",
       "      <td>48086.17</td>\n",
       "      <td>312153.061</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>20200617</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>67.00</td>\n",
       "      <td>69.19</td>\n",
       "      <td>66.23</td>\n",
       "      <td>67.41</td>\n",
       "      <td>66.58</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.2466</td>\n",
       "      <td>55550.50</td>\n",
       "      <td>376356.761</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>20200616</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>63.63</td>\n",
       "      <td>67.79</td>\n",
       "      <td>62.28</td>\n",
       "      <td>66.58</td>\n",
       "      <td>63.15</td>\n",
       "      <td>3.43</td>\n",
       "      <td>5.4315</td>\n",
       "      <td>62299.90</td>\n",
       "      <td>409306.837</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>20200220</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.07</td>\n",
       "      <td>6.23</td>\n",
       "      <td>5.94</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.08</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9737</td>\n",
       "      <td>136050.11</td>\n",
       "      <td>83301.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>660</th>\n",
       "      <td>20200219</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.23</td>\n",
       "      <td>6.26</td>\n",
       "      <td>6.04</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.28</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-3.1847</td>\n",
       "      <td>126933.50</td>\n",
       "      <td>78189.836</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>661</th>\n",
       "      <td>20200218</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.39</td>\n",
       "      <td>6.06</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.16</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9481</td>\n",
       "      <td>174172.50</td>\n",
       "      <td>108591.280</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>662</th>\n",
       "      <td>20200217</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.95</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.06</td>\n",
       "      <td>0.10</td>\n",
       "      <td>1.6502</td>\n",
       "      <td>126684.60</td>\n",
       "      <td>76711.019</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>20200214</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.79</td>\n",
       "      <td>6.19</td>\n",
       "      <td>5.71</td>\n",
       "      <td>6.06</td>\n",
       "      <td>5.99</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1686</td>\n",
       "      <td>160717.53</td>\n",
       "      <td>95509.993</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>20200213</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.44</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.92</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1824</td>\n",
       "      <td>280371.90</td>\n",
       "      <td>173459.234</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>20200212</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.46</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.45</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>10.0372</td>\n",
       "      <td>155563.45</td>\n",
       "      <td>89984.065</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>20200211</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.49</td>\n",
       "      <td>5.37</td>\n",
       "      <td>5.38</td>\n",
       "      <td>5.47</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.6453</td>\n",
       "      <td>39459.27</td>\n",
       "      <td>21350.565</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>20200210</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.27</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.32</td>\n",
       "      <td>0.15</td>\n",
       "      <td>2.8195</td>\n",
       "      <td>46564.08</td>\n",
       "      <td>25228.387</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>668</th>\n",
       "      <td>20200207</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.34</td>\n",
       "      <td>5.13</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.19</td>\n",
       "      <td>0.13</td>\n",
       "      <td>2.5048</td>\n",
       "      <td>53671.38</td>\n",
       "      <td>28235.062</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>669</th>\n",
       "      <td>20200206</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.11</td>\n",
       "      <td>5.22</td>\n",
       "      <td>5.10</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.14</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.9728</td>\n",
       "      <td>50352.95</td>\n",
       "      <td>26031.271</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>670</th>\n",
       "      <td>20200205</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.23</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.14</td>\n",
       "      <td>5.08</td>\n",
       "      <td>0.06</td>\n",
       "      <td>1.1811</td>\n",
       "      <td>47655.51</td>\n",
       "      <td>24578.871</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>671</th>\n",
       "      <td>20200204</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.23</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.08</td>\n",
       "      <td>5.24</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-3.0534</td>\n",
       "      <td>77073.61</td>\n",
       "      <td>38838.267</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>672</th>\n",
       "      <td>20200203</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.82</td>\n",
       "      <td>-0.58</td>\n",
       "      <td>-9.9656</td>\n",
       "      <td>11901.00</td>\n",
       "      <td>6236.124</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>673</th>\n",
       "      <td>20200123</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.98</td>\n",
       "      <td>6.02</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.82</td>\n",
       "      <td>5.99</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.8381</td>\n",
       "      <td>48644.92</td>\n",
       "      <td>28534.580</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>674</th>\n",
       "      <td>20200122</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.99</td>\n",
       "      <td>6.00</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1667</td>\n",
       "      <td>48130.38</td>\n",
       "      <td>28812.409</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>675</th>\n",
       "      <td>20200121</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.96</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.15</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-2.4390</td>\n",
       "      <td>57842.42</td>\n",
       "      <td>34871.239</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>676</th>\n",
       "      <td>20200120</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.15</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8197</td>\n",
       "      <td>49417.89</td>\n",
       "      <td>30162.397</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>677</th>\n",
       "      <td>20200117</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.14</td>\n",
       "      <td>6.22</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.19</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.4540</td>\n",
       "      <td>59659.40</td>\n",
       "      <td>36665.953</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>678</th>\n",
       "      <td>20200116</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.36</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.6730</td>\n",
       "      <td>78552.90</td>\n",
       "      <td>48990.967</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>679</th>\n",
       "      <td>20200115</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.55</td>\n",
       "      <td>6.60</td>\n",
       "      <td>6.25</td>\n",
       "      <td>6.36</td>\n",
       "      <td>6.59</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-3.4901</td>\n",
       "      <td>148040.02</td>\n",
       "      <td>93985.570</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>680</th>\n",
       "      <td>20200114</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.48</td>\n",
       "      <td>6.92</td>\n",
       "      <td>6.45</td>\n",
       "      <td>6.59</td>\n",
       "      <td>6.54</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.7645</td>\n",
       "      <td>211606.87</td>\n",
       "      <td>141252.242</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>20200113</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.50</td>\n",
       "      <td>6.62</td>\n",
       "      <td>6.41</td>\n",
       "      <td>6.54</td>\n",
       "      <td>6.71</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.5335</td>\n",
       "      <td>260810.94</td>\n",
       "      <td>169894.614</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>20200110</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.71</td>\n",
       "      <td>5.97</td>\n",
       "      <td>6.71</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.61</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>332168.68</td>\n",
       "      <td>215221.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>683</th>\n",
       "      <td>20200109</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.37</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.05</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8264</td>\n",
       "      <td>140280.25</td>\n",
       "      <td>85630.713</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>20200108</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.52</td>\n",
       "      <td>6.01</td>\n",
       "      <td>6.05</td>\n",
       "      <td>5.93</td>\n",
       "      <td>0.12</td>\n",
       "      <td>2.0236</td>\n",
       "      <td>182015.88</td>\n",
       "      <td>111934.573</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>20200107</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.75</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.75</td>\n",
       "      <td>5.93</td>\n",
       "      <td>5.72</td>\n",
       "      <td>0.21</td>\n",
       "      <td>3.6713</td>\n",
       "      <td>101464.57</td>\n",
       "      <td>59886.982</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>20200106</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.72</td>\n",
       "      <td>5.69</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.5272</td>\n",
       "      <td>28396.10</td>\n",
       "      <td>16216.815</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>20200103</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.66</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.69</td>\n",
       "      <td>5.67</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.3527</td>\n",
       "      <td>23224.10</td>\n",
       "      <td>13208.640</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>20200102</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.68</td>\n",
       "      <td>5.60</td>\n",
       "      <td>5.67</td>\n",
       "      <td>5.60</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.2500</td>\n",
       "      <td>30157.31</td>\n",
       "      <td>17036.562</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>689 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
       "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
       "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
       "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
       "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
       "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
       "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
       "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
       "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
       "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
       "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
       "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
       "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
       "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
       "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
       "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
       "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
       "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
       "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
       "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
       "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
       "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
       "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
       "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
       "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
       "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
       "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
       "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
       "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
       "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
       "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "659    20200220  002350.SZ   6.07   6.23   5.94   6.20       6.08    0.12   \n",
       "660    20200219  002350.SZ   6.23   6.26   6.04   6.08       6.28   -0.20   \n",
       "661    20200218  002350.SZ   6.10   6.39   6.06   6.28       6.16    0.12   \n",
       "662    20200217  002350.SZ   6.00   6.17   5.95   6.16       6.06    0.10   \n",
       "663    20200214  002350.SZ   5.79   6.19   5.71   6.06       5.99    0.07   \n",
       "664    20200213  002350.SZ   6.20   6.44   5.99   5.99       5.92    0.07   \n",
       "665    20200212  002350.SZ   5.46   5.92   5.45   5.92       5.38    0.54   \n",
       "666    20200211  002350.SZ   5.47   5.49   5.37   5.38       5.47   -0.09   \n",
       "667    20200210  002350.SZ   5.32   5.47   5.27   5.47       5.32    0.15   \n",
       "668    20200207  002350.SZ   5.19   5.34   5.13   5.32       5.19    0.13   \n",
       "669    20200206  002350.SZ   5.11   5.22   5.10   5.19       5.14    0.05   \n",
       "670    20200205  002350.SZ   5.09   5.23   5.09   5.14       5.08    0.06   \n",
       "671    20200204  002350.SZ   4.72   5.23   4.72   5.08       5.24   -0.16   \n",
       "672    20200203  002350.SZ   5.24   5.24   5.24   5.24       5.82   -0.58   \n",
       "673    20200123  002350.SZ   5.98   6.02   5.74   5.82       5.99   -0.17   \n",
       "674    20200122  002350.SZ   5.92   6.07   5.83   5.99       6.00   -0.01   \n",
       "675    20200121  002350.SZ   6.16   6.17   5.96   6.00       6.15   -0.15   \n",
       "676    20200120  002350.SZ   6.08   6.16   6.05   6.15       6.10    0.05   \n",
       "677    20200117  002350.SZ   6.14   6.22   6.10   6.10       6.19   -0.09   \n",
       "678    20200116  002350.SZ   6.34   6.34   6.19   6.19       6.36   -0.17   \n",
       "679    20200115  002350.SZ   6.55   6.60   6.25   6.36       6.59   -0.23   \n",
       "680    20200114  002350.SZ   6.48   6.92   6.45   6.59       6.54    0.05   \n",
       "681    20200113  002350.SZ   6.50   6.62   6.41   6.54       6.71   -0.17   \n",
       "682    20200110  002350.SZ   6.05   6.71   5.97   6.71       6.10    0.61   \n",
       "683    20200109  002350.SZ   6.28   6.37   5.92   6.10       6.05    0.05   \n",
       "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
       "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
       "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
       "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
       "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
       "\n",
       "     pct_chg        vol      amount  avg_close  \n",
       "0     4.3701   48231.39  378538.641  75.799058  \n",
       "1     1.1012   45510.24  349243.253  75.799058  \n",
       "2     6.1699   40116.85  298893.827  75.799058  \n",
       "3    -8.5534   45608.24  338125.593  75.799058  \n",
       "4     0.9493   46867.92  367416.632  75.799058  \n",
       "5     4.1300   36207.00  275623.622  75.799058  \n",
       "6     4.3521   29076.21  212671.328  75.799058  \n",
       "7    -0.0424   34827.97  242427.871  75.799058  \n",
       "8     2.0614   37857.31  265442.956  75.799058  \n",
       "9    -9.9909   51816.84  377971.397  75.799058  \n",
       "10    1.7023   37215.87  286581.438  75.799058  \n",
       "11   -1.9537   35784.18  271008.151  75.799058  \n",
       "12    4.3050   43903.29  333576.063  75.799058  \n",
       "13    0.6793   46695.92  347164.239  75.799058  \n",
       "14    3.4289   54826.16  399887.616  75.799058  \n",
       "15   -1.2901   34518.84  246140.556  75.799058  \n",
       "16    1.3924   59030.63  423139.793  75.799058  \n",
       "17   -0.9473   49749.56  351523.864  75.799058  \n",
       "18   -0.0139   44320.35  317241.463  75.799058  \n",
       "19   -4.2800   49920.29  363465.213  75.799058  \n",
       "20   -2.5468   47894.86  358618.948  75.799058  \n",
       "21    0.5750   40548.34  315525.626  75.799058  \n",
       "22    7.1859   47526.42  354810.200  75.799058  \n",
       "23    0.2669   40287.73  286346.167  75.799058  \n",
       "24    6.2687   57229.92  404187.925  75.799058  \n",
       "25    0.0597   39436.54  264723.283  75.799058  \n",
       "26    4.2341   43957.20  292223.754  75.799058  \n",
       "27   -4.7026   48086.17  312153.061  75.799058  \n",
       "28    1.2466   55550.50  376356.761  75.799058  \n",
       "29    5.4315   62299.90  409306.837  75.799058  \n",
       "..       ...        ...         ...        ...  \n",
       "659   1.9737  136050.11   83301.161   5.705693  \n",
       "660  -3.1847  126933.50   78189.836   5.705693  \n",
       "661   1.9481  174172.50  108591.280   5.705693  \n",
       "662   1.6502  126684.60   76711.019   5.705693  \n",
       "663   1.1686  160717.53   95509.993   5.705693  \n",
       "664   1.1824  280371.90  173459.234   5.705693  \n",
       "665  10.0372  155563.45   89984.065   5.705693  \n",
       "666  -1.6453   39459.27   21350.565   5.705693  \n",
       "667   2.8195   46564.08   25228.387   5.705693  \n",
       "668   2.5048   53671.38   28235.062   5.705693  \n",
       "669   0.9728   50352.95   26031.271   5.705693  \n",
       "670   1.1811   47655.51   24578.871   5.705693  \n",
       "671  -3.0534   77073.61   38838.267   5.705693  \n",
       "672  -9.9656   11901.00    6236.124   5.705693  \n",
       "673  -2.8381   48644.92   28534.580   5.705693  \n",
       "674  -0.1667   48130.38   28812.409   5.705693  \n",
       "675  -2.4390   57842.42   34871.239   5.705693  \n",
       "676   0.8197   49417.89   30162.397   5.705693  \n",
       "677  -1.4540   59659.40   36665.953   5.705693  \n",
       "678  -2.6730   78552.90   48990.967   5.705693  \n",
       "679  -3.4901  148040.02   93985.570   5.705693  \n",
       "680   0.7645  211606.87  141252.242   5.705693  \n",
       "681  -2.5335  260810.94  169894.614   5.705693  \n",
       "682  10.0000  332168.68  215221.161   5.705693  \n",
       "683   0.8264  140280.25   85630.713   5.705693  \n",
       "684   2.0236  182015.88  111934.573   5.705693  \n",
       "685   3.6713  101464.57   59886.982   5.705693  \n",
       "686   0.5272   28396.10   16216.815   5.705693  \n",
       "687   0.3527   23224.10   13208.640   5.705693  \n",
       "688   1.2500   30157.31   17036.562   5.705693  \n",
       "\n",
       "[689 rows x 12 columns]"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_trans = df\n",
    "df_trans['avg_close'] = df_trans.groupby('ts_code')['close'].transform('mean')\n",
    "df_trans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景一\n",
    "\n",
    "我们拿到了一个数据集multi_stock_data.csv，里面包含着5个股票在2020年一段时间的日价格数据，我们想知道每个股票的最大涨幅（pct_chg）各自是多少？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ts_code\n",
       "002350.SZ    10.0372\n",
       "002660.SZ     9.9886\n",
       "002747.SZ    10.0402\n",
       "300685.SZ     7.1859\n",
       "603288.SH    10.0009\n",
       "Name: pct_chg, dtype: float64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "best_perform = df.groupby('ts_code')['pct_chg'].apply(max)\n",
    "best_perform"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景二\n",
    "\n",
    "我们拿到了5个股票在2020年一段时间的日价格数据，我们想知道每个股票的第二大交易发生在什么时间？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>amount</th>\n",
       "      <th>trade_date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>249671.626</td>\n",
       "      <td>20200326.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002660.SZ</td>\n",
       "      <td>308017.806</td>\n",
       "      <td>20200326.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>554783.774</td>\n",
       "      <td>20200225.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>409306.837</td>\n",
       "      <td>20200616.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603288.SH</td>\n",
       "      <td>1156858.738</td>\n",
       "      <td>20200723.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code       amount  trade_date\n",
       "0  002350.SZ   249671.626  20200326.0\n",
       "1  002660.SZ   308017.806  20200326.0\n",
       "2  002747.SZ   554783.774  20200225.0\n",
       "3  300685.SZ   409306.837  20200616.0\n",
       "4  603288.SH  1156858.738  20200723.0"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_second_largest(x):\n",
    "    return x.iloc[1,:]\n",
    "      # 读取第2行的所有列\n",
    "      #   Pandas之iloc、loc：\n",
    "      #   https://blog.csdn.net/weixin_44835732/article/details/105160453\n",
    "\n",
    "\n",
    "# 第二大交易发生在什么时间\n",
    "df_tmp = df.sort_values(by = ['ts_code', 'amount'], ascending = [True,False])\n",
    "df_tmp\n",
    "df_new = df_tmp.groupby('ts_code')[['amount','trade_date']].apply(get_second_largest).reset_index()\n",
    "df_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 例子：\n",
    "Pandas之iloc、loc：\n",
    "https://blog.csdn.net/weixin_44835732/article/details/105160453"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   A  B  C\n",
      "0  1  4  7\n",
      "1  2  5  8\n",
      "2  3  6  9\n",
      "\n",
      "\n",
      "   index  A  B  C\n",
      "0      0  1  4  7\n",
      "1      1  2  5  8\n",
      "2      2  3  6  9\n",
      "\n",
      "\n",
      "   A  B  C\n",
      "0  1  4  7\n",
      "1  2  5  8\n",
      "2  3  6  9\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# reset_index()\n",
    "#   用索引重置生成一个新的DataFrame或Series\n",
    "import pandas as pd \n",
    "df3 = pd.DataFrame(data={'A':[1,2,3],'B':[4,5,6],'C':[7,8,9]})\n",
    "print(df3)\n",
    "print('\\n')\n",
    "\n",
    "print(df3.reset_index()) # 会将原来的索引index作为新的一列\n",
    "print('\\n')\n",
    " \n",
    "print(df3.reset_index(drop=True)) # 使用drop参数设置去掉原索引\n",
    "print('\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 作业\n",
    "\n",
    "1. 了解如何使用下列的函数：去重（df.drop_duplicates）, 去空值（df.dropna），合并（df.merge, dr.concat），分组（df.groupby）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
      "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
      "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
      "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
      "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
      "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
      "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
      "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
      "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
      "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
      "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
      "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
      "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
      "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
      "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
      "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
      "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
      "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
      "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
      "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
      "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
      "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
      "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
      "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
      "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
      "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
      "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
      "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
      "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
      "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "659    20200220  002350.SZ   6.07   6.23   5.94   6.20       6.08    0.12   \n",
      "660    20200219  002350.SZ   6.23   6.26   6.04   6.08       6.28   -0.20   \n",
      "661    20200218  002350.SZ   6.10   6.39   6.06   6.28       6.16    0.12   \n",
      "662    20200217  002350.SZ   6.00   6.17   5.95   6.16       6.06    0.10   \n",
      "663    20200214  002350.SZ   5.79   6.19   5.71   6.06       5.99    0.07   \n",
      "664    20200213  002350.SZ   6.20   6.44   5.99   5.99       5.92    0.07   \n",
      "665    20200212  002350.SZ   5.46   5.92   5.45   5.92       5.38    0.54   \n",
      "666    20200211  002350.SZ   5.47   5.49   5.37   5.38       5.47   -0.09   \n",
      "667    20200210  002350.SZ   5.32   5.47   5.27   5.47       5.32    0.15   \n",
      "668    20200207  002350.SZ   5.19   5.34   5.13   5.32       5.19    0.13   \n",
      "669    20200206  002350.SZ   5.11   5.22   5.10   5.19       5.14    0.05   \n",
      "670    20200205  002350.SZ   5.09   5.23   5.09   5.14       5.08    0.06   \n",
      "671    20200204  002350.SZ   4.72   5.23   4.72   5.08       5.24   -0.16   \n",
      "672    20200203  002350.SZ   5.24   5.24   5.24   5.24       5.82   -0.58   \n",
      "673    20200123  002350.SZ   5.98   6.02   5.74   5.82       5.99   -0.17   \n",
      "674    20200122  002350.SZ   5.92   6.07   5.83   5.99       6.00   -0.01   \n",
      "675    20200121  002350.SZ   6.16   6.17   5.96   6.00       6.15   -0.15   \n",
      "676    20200120  002350.SZ   6.08   6.16   6.05   6.15       6.10    0.05   \n",
      "677    20200117  002350.SZ   6.14   6.22   6.10   6.10       6.19   -0.09   \n",
      "678    20200116  002350.SZ   6.34   6.34   6.19   6.19       6.36   -0.17   \n",
      "679    20200115  002350.SZ   6.55   6.60   6.25   6.36       6.59   -0.23   \n",
      "680    20200114  002350.SZ   6.48   6.92   6.45   6.59       6.54    0.05   \n",
      "681    20200113  002350.SZ   6.50   6.62   6.41   6.54       6.71   -0.17   \n",
      "682    20200110  002350.SZ   6.05   6.71   5.97   6.71       6.10    0.61   \n",
      "683    20200109  002350.SZ   6.28   6.37   5.92   6.10       6.05    0.05   \n",
      "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
      "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
      "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
      "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
      "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "0     4.3701   48231.39  378538.641  \n",
      "1     1.1012   45510.24  349243.253  \n",
      "2     6.1699   40116.85  298893.827  \n",
      "3    -8.5534   45608.24  338125.593  \n",
      "4     0.9493   46867.92  367416.632  \n",
      "5     4.1300   36207.00  275623.622  \n",
      "6     4.3521   29076.21  212671.328  \n",
      "7    -0.0424   34827.97  242427.871  \n",
      "8     2.0614   37857.31  265442.956  \n",
      "9    -9.9909   51816.84  377971.397  \n",
      "10    1.7023   37215.87  286581.438  \n",
      "11   -1.9537   35784.18  271008.151  \n",
      "12    4.3050   43903.29  333576.063  \n",
      "13    0.6793   46695.92  347164.239  \n",
      "14    3.4289   54826.16  399887.616  \n",
      "15   -1.2901   34518.84  246140.556  \n",
      "16    1.3924   59030.63  423139.793  \n",
      "17   -0.9473   49749.56  351523.864  \n",
      "18   -0.0139   44320.35  317241.463  \n",
      "19   -4.2800   49920.29  363465.213  \n",
      "20   -2.5468   47894.86  358618.948  \n",
      "21    0.5750   40548.34  315525.626  \n",
      "22    7.1859   47526.42  354810.200  \n",
      "23    0.2669   40287.73  286346.167  \n",
      "24    6.2687   57229.92  404187.925  \n",
      "25    0.0597   39436.54  264723.283  \n",
      "26    4.2341   43957.20  292223.754  \n",
      "27   -4.7026   48086.17  312153.061  \n",
      "28    1.2466   55550.50  376356.761  \n",
      "29    5.4315   62299.90  409306.837  \n",
      "..       ...        ...         ...  \n",
      "659   1.9737  136050.11   83301.161  \n",
      "660  -3.1847  126933.50   78189.836  \n",
      "661   1.9481  174172.50  108591.280  \n",
      "662   1.6502  126684.60   76711.019  \n",
      "663   1.1686  160717.53   95509.993  \n",
      "664   1.1824  280371.90  173459.234  \n",
      "665  10.0372  155563.45   89984.065  \n",
      "666  -1.6453   39459.27   21350.565  \n",
      "667   2.8195   46564.08   25228.387  \n",
      "668   2.5048   53671.38   28235.062  \n",
      "669   0.9728   50352.95   26031.271  \n",
      "670   1.1811   47655.51   24578.871  \n",
      "671  -3.0534   77073.61   38838.267  \n",
      "672  -9.9656   11901.00    6236.124  \n",
      "673  -2.8381   48644.92   28534.580  \n",
      "674  -0.1667   48130.38   28812.409  \n",
      "675  -2.4390   57842.42   34871.239  \n",
      "676   0.8197   49417.89   30162.397  \n",
      "677  -1.4540   59659.40   36665.953  \n",
      "678  -2.6730   78552.90   48990.967  \n",
      "679  -3.4901  148040.02   93985.570  \n",
      "680   0.7645  211606.87  141252.242  \n",
      "681  -2.5335  260810.94  169894.614  \n",
      "682  10.0000  332168.68  215221.161  \n",
      "683   0.8264  140280.25   85630.713  \n",
      "684   2.0236  182015.88  111934.573  \n",
      "685   3.6713  101464.57   59886.982  \n",
      "686   0.5272   28396.10   16216.815  \n",
      "687   0.3527   23224.10   13208.640  \n",
      "688   1.2500   30157.31   17036.562  \n",
      "\n",
      "[689 rows x 11 columns]\n",
      "------------------------df.drop_duplicates()\n",
      "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
      "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
      "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
      "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
      "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
      "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
      "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
      "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
      "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
      "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
      "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
      "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
      "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
      "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
      "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
      "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
      "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
      "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
      "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
      "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
      "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
      "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
      "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
      "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
      "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
      "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
      "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
      "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
      "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
      "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
      "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
      "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
      "659    20200220  002350.SZ   6.07   6.23   5.94   6.20       6.08    0.12   \n",
      "660    20200219  002350.SZ   6.23   6.26   6.04   6.08       6.28   -0.20   \n",
      "661    20200218  002350.SZ   6.10   6.39   6.06   6.28       6.16    0.12   \n",
      "662    20200217  002350.SZ   6.00   6.17   5.95   6.16       6.06    0.10   \n",
      "663    20200214  002350.SZ   5.79   6.19   5.71   6.06       5.99    0.07   \n",
      "664    20200213  002350.SZ   6.20   6.44   5.99   5.99       5.92    0.07   \n",
      "665    20200212  002350.SZ   5.46   5.92   5.45   5.92       5.38    0.54   \n",
      "666    20200211  002350.SZ   5.47   5.49   5.37   5.38       5.47   -0.09   \n",
      "667    20200210  002350.SZ   5.32   5.47   5.27   5.47       5.32    0.15   \n",
      "668    20200207  002350.SZ   5.19   5.34   5.13   5.32       5.19    0.13   \n",
      "669    20200206  002350.SZ   5.11   5.22   5.10   5.19       5.14    0.05   \n",
      "670    20200205  002350.SZ   5.09   5.23   5.09   5.14       5.08    0.06   \n",
      "671    20200204  002350.SZ   4.72   5.23   4.72   5.08       5.24   -0.16   \n",
      "672    20200203  002350.SZ   5.24   5.24   5.24   5.24       5.82   -0.58   \n",
      "673    20200123  002350.SZ   5.98   6.02   5.74   5.82       5.99   -0.17   \n",
      "674    20200122  002350.SZ   5.92   6.07   5.83   5.99       6.00   -0.01   \n",
      "675    20200121  002350.SZ   6.16   6.17   5.96   6.00       6.15   -0.15   \n",
      "676    20200120  002350.SZ   6.08   6.16   6.05   6.15       6.10    0.05   \n",
      "677    20200117  002350.SZ   6.14   6.22   6.10   6.10       6.19   -0.09   \n",
      "678    20200116  002350.SZ   6.34   6.34   6.19   6.19       6.36   -0.17   \n",
      "679    20200115  002350.SZ   6.55   6.60   6.25   6.36       6.59   -0.23   \n",
      "680    20200114  002350.SZ   6.48   6.92   6.45   6.59       6.54    0.05   \n",
      "681    20200113  002350.SZ   6.50   6.62   6.41   6.54       6.71   -0.17   \n",
      "682    20200110  002350.SZ   6.05   6.71   5.97   6.71       6.10    0.61   \n",
      "683    20200109  002350.SZ   6.28   6.37   5.92   6.10       6.05    0.05   \n",
      "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
      "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
      "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
      "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
      "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "0     4.3701   48231.39  378538.641  \n",
      "1     1.1012   45510.24  349243.253  \n",
      "2     6.1699   40116.85  298893.827  \n",
      "3    -8.5534   45608.24  338125.593  \n",
      "4     0.9493   46867.92  367416.632  \n",
      "5     4.1300   36207.00  275623.622  \n",
      "6     4.3521   29076.21  212671.328  \n",
      "7    -0.0424   34827.97  242427.871  \n",
      "8     2.0614   37857.31  265442.956  \n",
      "9    -9.9909   51816.84  377971.397  \n",
      "10    1.7023   37215.87  286581.438  \n",
      "11   -1.9537   35784.18  271008.151  \n",
      "12    4.3050   43903.29  333576.063  \n",
      "13    0.6793   46695.92  347164.239  \n",
      "14    3.4289   54826.16  399887.616  \n",
      "15   -1.2901   34518.84  246140.556  \n",
      "16    1.3924   59030.63  423139.793  \n",
      "17   -0.9473   49749.56  351523.864  \n",
      "18   -0.0139   44320.35  317241.463  \n",
      "19   -4.2800   49920.29  363465.213  \n",
      "20   -2.5468   47894.86  358618.948  \n",
      "21    0.5750   40548.34  315525.626  \n",
      "22    7.1859   47526.42  354810.200  \n",
      "23    0.2669   40287.73  286346.167  \n",
      "24    6.2687   57229.92  404187.925  \n",
      "25    0.0597   39436.54  264723.283  \n",
      "26    4.2341   43957.20  292223.754  \n",
      "27   -4.7026   48086.17  312153.061  \n",
      "28    1.2466   55550.50  376356.761  \n",
      "29    5.4315   62299.90  409306.837  \n",
      "..       ...        ...         ...  \n",
      "659   1.9737  136050.11   83301.161  \n",
      "660  -3.1847  126933.50   78189.836  \n",
      "661   1.9481  174172.50  108591.280  \n",
      "662   1.6502  126684.60   76711.019  \n",
      "663   1.1686  160717.53   95509.993  \n",
      "664   1.1824  280371.90  173459.234  \n",
      "665  10.0372  155563.45   89984.065  \n",
      "666  -1.6453   39459.27   21350.565  \n",
      "667   2.8195   46564.08   25228.387  \n",
      "668   2.5048   53671.38   28235.062  \n",
      "669   0.9728   50352.95   26031.271  \n",
      "670   1.1811   47655.51   24578.871  \n",
      "671  -3.0534   77073.61   38838.267  \n",
      "672  -9.9656   11901.00    6236.124  \n",
      "673  -2.8381   48644.92   28534.580  \n",
      "674  -0.1667   48130.38   28812.409  \n",
      "675  -2.4390   57842.42   34871.239  \n",
      "676   0.8197   49417.89   30162.397  \n",
      "677  -1.4540   59659.40   36665.953  \n",
      "678  -2.6730   78552.90   48990.967  \n",
      "679  -3.4901  148040.02   93985.570  \n",
      "680   0.7645  211606.87  141252.242  \n",
      "681  -2.5335  260810.94  169894.614  \n",
      "682  10.0000  332168.68  215221.161  \n",
      "683   0.8264  140280.25   85630.713  \n",
      "684   2.0236  182015.88  111934.573  \n",
      "685   3.6713  101464.57   59886.982  \n",
      "686   0.5272   28396.10   16216.815  \n",
      "687   0.3527   23224.10   13208.640  \n",
      "688   1.2500   30157.31   17036.562  \n",
      "\n",
      "[689 rows x 11 columns]\n",
      "------------------------删除在brand列中重复的数据行\n",
      "     trade_date    ts_code    open    high     low   close  pre_close  change  \\\n",
      "0      20200729  300685.SZ   76.88   80.50   75.22   79.53      76.20    3.33   \n",
      "138    20200729  002747.SZ   15.58   16.69   15.40   16.53      15.60    0.93   \n",
      "276    20200729  603288.SH  145.14  148.80  143.79  148.60     146.19    2.41   \n",
      "414    20200729  002660.SZ    8.73    8.93    8.61    8.92       8.72    0.20   \n",
      "552    20200729  002350.SZ    5.36    5.46    5.28    5.45       5.37    0.08   \n",
      "\n",
      "     pct_chg        vol      amount  \n",
      "0     4.3701   48231.39  378538.641  \n",
      "138   5.9615  187518.29  300984.436  \n",
      "276   1.6485   54572.25  798579.731  \n",
      "414   2.2936   63362.62   55703.310  \n",
      "552   1.4898   42830.66   23080.964  \n",
      "------------------------重复行保留第一次出现的行，删除其他行\n"
     ]
    }
   ],
   "source": [
    "print(df)\n",
    "# (1)去重（df.drop_duplicates）\n",
    "#   https://blog.csdn.net/c_lanxiaofang/article/details/125880941\n",
    "print(\"------------------------df.drop_duplicates()\")\n",
    "print(df.drop_duplicates())\n",
    "print(\"------------------------删除在ts_code列中重复的数据行\")\n",
    "print(df.drop_duplicates(subset='ts_code'))\n",
    "\n",
    "# (2)去空值（df.dropna）\n",
    "#   https://blog.csdn.net/Hudas/article/details/122924791\n",
    "import pandas as pd\n",
    "import numpy as np \n",
    "# 原数据\n",
    "df5 = pd.DataFrame({'A':['a1','a1','a2','a2'],\n",
    "                'B':['b1','b2',None,'b2'],\n",
    "                'C':[1,2,3,4],\n",
    "                'D':[5,6,None,8],\n",
    "                'E':[5,None,7,8]\n",
    "                 })\n",
    "# 删除有缺失值的行\n",
    "res1 = df5.dropna()\n",
    "# 删除有缺失值的列\n",
    "res2 = df5.dropna(1)\n",
    "\n",
    "# (3)合并（df.merge, dr.concat）\n",
    "#   1.pandas.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, keys=None, levels=None, names=None, verify_integrity=False, sort=None, copy=True)\n",
    "#       objs：series，dataframe等要拼接的对象\n",
    "#       axis：指明连接的轴向， 0：index行， 1：columns列，默认为0即行连接\n",
    "#       join：指明连接方式 ，inner交集，outer并集，默认为outer并集\n",
    "#       join_axes：自定义的索引。作为join中交集与并集的补充\n",
    "#       ignore_index=True：重建索引\n",
    "#   2.DataFrame.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None)\n",
    "#       left和right：要拼接的series或者DF，同concat中objs类似，只是concat中多个DF拼接需要写到列表中且可以多个DF拼接，merge只能是俩DF\n",
    "#       how：连接方式，有inner、left、right、outer，默认为inner\n",
    "#       on：用于连接的列索引名称，必须同时存在于左、右两个DataFrame中，默认是以两个DataFrame列名的交集作为连接键，若要实现多键连接，‘on’参数后传入多键列表即可\n",
    "#       left_on：左侧DataFrame中用于连接键的列名，这个参数在左右列名不同但代表的含义相同时非常有用；\n",
    "#       right_on：右侧DataFrame中用于连接键的列名\n",
    "#   原文链接：https://blog.csdn.net/Lian_Ge_Blog/article/details/123402456\n",
    "\n",
    "# (4)分组（df.groupby）\n",
    "#    Pandas-分组：df.groupby();\n",
    "#       https://zhuanlan.zhihu.com/p/149126583   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJztvXl8XHd57//+zqaZ0b6vtrzES+zEexJnMwlZgFJICmkbWiABemkghQv3d6HQ0uXe3raU8qIFUhICNDct6QUaSEghQIAQnOA4iZ3EaxIv8iZLlrUvsy/f3x/nnNFImpFGoxnNSHrer5dfGp05M+fr0ZzPec7n+3yfR2mtEQRBEBYXtkIPQBAEQcg9Iu6CIAiLEBF3QRCERYiIuyAIwiJExF0QBGERIuIuCIKwCBFxFwRBWISIuAuCICxCRNwFQRAWIY5CHbiurk6vWLGiUIcXBEFYkOzfv79Pa10/034FE/cVK1awb9++Qh1eEARhQaKUOpPJfmLLCIIgLEJE3AVBEBYhIu6CIAiLEBF3QRCERYiIuyAIwiJExF0QBGERIuIuCIKwCBFxF4Qi5Ey/j93Hegs9DGEBI+IuCEXIg7s7+Nj/e6XQwxA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+GDZOOoh+zUurPgSjwiLUpxXsUw5j/Gvhz4C9T7F/oMaf7jIv53Es35mI+/9Ky6MVda91l/rwIPIZxq9cJ/MC8nXoRiGPUjOjE8C8t2hi/BSvkeO8CfmDu8p+M364WfLzmGDq11i+Yvz+KcYL0WLeo5s+LSfsX65hRSt0F/Dbwh9o0VinuMa8EDiilTpvjelkp1UThx5xuvEV77pF+zMV8/qVlUYu7edtabj3GmDA7DDwOvNncvhZj4qQPeAK4UylVopRaCawBXiyC8XYBbzJ3ezNw3Hz8BPB+c9Z+JzBsWSHzhdb6AnBOKbXO3HQTcNQc213mtruAHxb7mJVSbwX+FHin1tqf9JKCfi+mGfPLWusGrfUKrfUKDLHZZu5b0M95mu9FUZ57M4y5aM+/6XAUegB5phF4zLjrwwH8h9b6p0opF/CvSqnDQBi4y4zSjiilvofxB40C92qtY0Uw3jHgy0opBxAELC/+SYwZ+xOAH/jAPI41mY8Bj5ifa4c5DhvGLfeHgLPA75r7FvOYX8LI1vi5+TfYq7W+R2td6O/FdGNORzF8zqnG66M4z73pxvxDivv8S4msUBUEQViELGpbRhAEYaki4i4IgrAIEXEXBEFYhIi4C4IgLEJE3AVBEBYhIu6CIAiLEBF3QRCERYiIuyAIwiLk/we6XzNuJ7K1SwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "df[df['ts_code'] == '002350.SZ']['close'].plot(y = 'close')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
